replace multiple characters one string php
str_replace(array(':', '\\', '/', '*'), ' ', $string);
4
6
// 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);
Thank you!
6
0
Are there any code examples left?
New code examples in category PHP