I need a similar function in PHP for this JavaScript function
text = text.replace(/ffc/g, "Hello");
I think preg_replace will do, but i'm not sure how to write the expression..
I want the regular expression similar to /ffc/g which is above, What I need exactly is to match the full word and case when performing the replace...
$text = preg_replace('/ffc/', 'replacement text', $subject);
The online manual for PHP is pretty amazing, and one of the languages best features:
http://php.net/preg_replace
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With