Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #replace #multiple #characters #string #php
ADD COMMENT
Topic
Name
7+2 =