Am I correct in thinking the following code should output what& #039 ;s up (*)
$foo = "what's up";
$foo = htmlspecialchars($foo, ENT_QUOTES);
print $foo;
When I check the page source I see what's up not what& #039 ;s up (*)
The same thing happens with htmlentities.
It translates &, < and > but doesn't seem to be picking up on the ENT_QUOTES
Have I misunderstood these functions or is there something wrong?
Many thanks.
- I've added the spaces to stop it rendering on this post as '