I want to know how i use htmlentities •' for ' in my code ?
How to escape single quote
hows apostrophe work in IE
while($row = pg_fetch_array($result))
{
if($row[3]=="")
{
$vmobj_Array[$i]=$row[0]."***".$row[1]."***".$row[2];
}
else
{
$vmobj_Array[$i]=$row[0].' ( '.$row[3].' )'."***".$row[1]."***".$row[2];
}
$i++;
}
I think every question should have an answer, so I'm posting here as well. Feel free to accept the answer someone else posted there just now.
htmlentities($str, ENT_QUOTES); or htmlspecialchars($str, ENT_QUOTES); should do the trick where $str should be replaced by the variable or string you want to escape (e.g., $row[0]). If you just want to add it, all you need to do is add it: print "Here's an apostrophe '";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With