How does the str_replace?

Hello, prompt, please, as this function is activated:

echo str_replace('aaabbb', '!', 'abcabc');
?>

The result: "!!!bbb".

I understand, for example how it works:

echo str_replace("Dylan","Bob","good morning Dylan!");
?>

The result will be: "good morning Dima!".

But the first option can not understand.
March 23rd 20 at 19:14
1 answer
March 23rd 20 at 19:16
Solution
echo = str_replace('aaabbb', '!', 'abcabc');

Works as: syntax error, unexpected '='

str_replace — Replace all occurrences of the search string...

The result: "!!!bbb".

What version of PHP? I normally code returned: "abcabc"
In the tutorial I watched. He did not try to run here and could not understand what was happening, thank you! - Brennon_Ondricka22 commented on March 23rd 20 at 19:19

Find more questions by tags PHP