I need to replace only the first match found in a string, how can I do this? Is there a way to make str_replace or ereg_replace only replace the first instance of the replace word it finds, or is there another function I can use? Thank you.
Check out http://www.php.net/preg_replace . You'll see that one of the parameters is the limit.
Diego