Is there any possibility to use str_replace for multiple value replacement in a single line. For example i want to replace \' \' with \'-\'>
This is how I did it to replace ' to '' so it doesn't break in SQL queries and " " with "" because people kept adding a space at the end of their emails:
$check = str_replace("'","''",$_POST['1']);
$checkbox1 = str_replace(" ","",$check);
For yours you could do this:
$check = str_replace("&","",$_POST['1']);
$checkbox1 = str_replace(" ","-",$check);