I want a version of str_replace() that only replaces the first occurrence of $search in the $subject. Is there an easy solution to thi
str_replace()
$search
$subject
$string = 'this is my world, not my world'; $find = 'world'; $replace = 'farm'; $result = preg_replace("/$find/",$replace,$string,1); echo $result;