Re: How do you remove Apostropies and Double Quotes?
Posted: Fri May 14, 2010 3:41 am
Interesting; I did some more research and stumbled across this fact - the echoing a variable inside a string, e.g.
Only works if the string is in double quotes. I never knew this before
and am quite annoyed! Anyway, that is the reason your previous enquiry...
- Use double quotes, then go through and escape all the other double quotes in the string
or
- You have to use single quotes and the concatenation dots.
Arrrgh!
Code: Select all
echo "My name is $name"...didn't work - it used single quotes. However, it does present a problem; either you can:echo '<td valign="top"><a href="index.php?page=emailid&id=' . $row->id . '&head=email detail" style="text-decoration: none;" title="' . htmlspecialchars($row->communication, ENT_QUOTES, "UTF-8") . '">' . $row->reason . '</a></td>';
- Use double quotes, then go through and escape all the other double quotes in the string
or
- You have to use single quotes and the concatenation dots.
Arrrgh!