Hello everybody,
I've a qusetion about using ereg_replace() function.
I need to replace ONLY the first result, except the others.
For example, when I have a data variable ($data) which containig some text, and I need to find names 'Goerge' and replace it with 'GeorgeIII', but I don not want to replace all 'Goerge' names, but OLNY the first one.
Do you know how can I do that?
In Perl, I can use:
$data=~s!George! GeorgeIII !m;
but when I use ereg_replace func. in PHP, it will replace ALL George names.
$data=ereg_replace("George","GeorgeIII",$data);
I used ereg_replace because I need an advanced expression for my real search.
Do you have an idea for that?
Thank you!
Monrey