I made a function for my website that converts special characters, in case someone will try to break out the system using colon, semicolons, single quotes or double quotes. I made an array of find which is the find variable in str_replace
and change which will be exchanged.
$find = array('"','\'','<3');
$change = array('"',''','♥');
$str = "This is a test ' " <3.";
$str = str_replace($find, $change, $str);
echo $str;
It literally prints the codes like " and supposedly it should be echoed as double quotes ("). I refreshed the page. It is still echoing the actual code.
Any help?