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

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -