Answers for "php replace number in string by n times 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
0

replace all numbers in string php

$words = preg_replace('/[0-9]+/', '', $words);
Posted by: Guest on October-21-2020

Code answers related to "php replace number in string by n times char"

Browse Popular Code Answers by Language