Answers for "php replace all words in string"

PHP
8

php replace string within string

$new_string = str_replace( $take_out, $put_in, $string);
Posted by: Guest on August-18-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

Code answers related to "php replace all words in string"

Browse Popular Code Answers by Language