Replace String in PHP


Replace String in PHP With str_replace Function

Replacing Parts of String With str_replace Function

$string = "I like to eat.";
echo $string; //
Output is:
I like to eat

$string = str_replace("eat","drink juice", $string);
echo $string;
New output is:
I like to drink juice.