There is no need for array_map. From the docs: "If subject is an array, then the search and replace is performed with every entry of subject, and the return value is an array as well."
I remember doing this before, but can't find the code. I use str_replace to replace one character like this: str_replace(':', ' ', $string); but I want to replace all the following characters \/:*?"<>|, without doing …
Is there a reason that I'm not seeing, why this doesn't work?
$string = $someLongUserGeneratedString;
$replaced = str_replace(' ', '_', $string);
echo $replaced;
The output still includes spaces... Any ideas would be awesome
I'm having some troubles with the PHP function str_replace when using arrays.
I have this message:
$message = strtolower("L rzzo rwldd ty esp mtdsza'd szdepw ty esp opgtw'd dple");
And I am trying to use str_replace like this:
$…