Possible Duplicate:
PHP str_replace
I have a string $html in which there is the text Greek and multiple times. These need to be replaced by Alpha, Beta, Gamma, Delta, Epsilon in that order. Like this:
<?php
$html = "Greek blablabla Greek Greek blabla " //input
$html = "Alpha blablabla Beta Gamma Delta blabla Epsilon" //output
or
$html = "Greek blabla Greek Greek bla Greek Greek" //input
$html = "Alpha blabla Beta Gamma bla Delta Epsilon" //output
or
$html = " blablablabla &nbps; " //input
$html = "Alpha Beta blablablabla Gamma Delta Epsilon" //output
or ....
?>
It doesn’t need to be solved with preg_replace but I think this is works best with it.
Thanks again!
Short and to the point:
See it in action.