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
Complementing what people said, remember that the entire string is an array:
$string = "Lorem ipsum lá lá lá"; $string[0] = "B"; echo $string;
"Borem ipsum lá lá lá"