Answers for "php replace multiple contineous char with one char"

PHP
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

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

Code answers related to "php replace multiple contineous char with one char"

Browse Popular Code Answers by Language