php - Replace multiple items in a string -
i've scraped html string website. in string contains multiple strings color:#0269d2. how can make str_replace code replace string color ?
for instance looping through color:#0269d in fulltext string variable?
str_replace("color:#0269d","color:#000000",$fulltext);
you pass array str_replace function , no need use loop
$a= array("color:#0269d","color:#000000"); $str= str_replace($a,"", $string);
Comments
Post a Comment