-3

i have this string:

 $string= " 22 December-28 December 2015";

exist a method in PHP with i can find the word "December" inside $string and changes it with another word ?

i would like a new:

 $string= " 22 Dicembre-28 Dicembre 2015";
Giovanni-Borgia
  • 393
  • 1
  • 2
  • 9

1 Answers1

4

You could use str_replace() function.

Something like this:

$string= " 22 December-28 December 2015";
$string = str_replace('December', 'Dicembre', $string);
openHex
  • 63
  • 1
  • 9