“PHP str_replace multiple” Code-Antworten

PHP str_replace multiple

str_replace(array(':', '\\', '/', '*'), ' ', $string);
Vadim

Ersetzen Sie mehrere Zeichen mit einem 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);
Clever Corncrake

PHP str_replace multiple

print str_replace(
    array("search1","search2"),
    array("replace1", "replace2"),
    "search1 search2"
);
Vadim

Ähnliche Antworten wie “PHP str_replace multiple”

Fragen ähnlich wie “PHP str_replace multiple”

Weitere verwandte Antworten zu “PHP str_replace multiple” auf PHP

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen