I had a situation where I had to replace the HTML tags with two different replacement results.
$trades = "<li>Sprinkler and Fire Protection Installer</li> <li>Steamfitter </li> <li>Terrazzo, Tile and Marble Setter</li>"; $s1 = str_replace('<li>', '"', $trades); $s2 = str_replace('</li>', '",', $s1); echo $s2;
result
"Installer of sprinklers and fire protection", "Steamboat", "Terrazzo, Tile and Marble Setter",
Tempteh Feb 15 '17 at 18:19 2017-02-15 18:19
source share