Answers for "multiple str replace php"

PHP
2

php str_replace multiple

str_replace(array(':', '\\', '/', '*'), ' ', $string);
Posted by: Guest on October-09-2020
1

replace multiple characters one string php

// Provides: You should eat pizza, beer, and ice cream every day
$phrase  = "You should eat fruits, vegetables, and fiber every day.";
$healthy = ["fruits", "vegetables", "fiber"];
$yummy   = ["pizza", "beer", "ice cream"];

$newPhrase = str_replace($healthy, $yummy, $phrase);
Posted by: Guest on August-03-2020
1

php str_replace multiple

print str_replace(
    array("search1","search2"),
    array("replace1", "replace2"),
    "search1 search2"
);
Posted by: Guest on October-09-2020
-1

how to replace multiple characters in a string in php

to replace double quotes, you can do this:
$newPhrase = str_replace('"', '', $phrase);
Posted by: Guest on July-29-2021

Browse Popular Code Answers by Language