Basically what I\'m looking for is the PHP version of this thread: Find, replace, and increment at each occurence of string
I would like to replace the keyword follow
Here's my two cents
function str_replace_once($correct, $wrong, $haystack) {
$wrong_string = '/' . $wrong . '/';
return preg_replace($wrong_string, $correct, $haystack, 1);
}
The above function is used to replace the string occurence only once, but you are free to edit the function to perform every other possible operation.