The Praetorian Posted January 12, 2007 Share Posted January 12, 2007 If I want to use an apostrophe, do I need to escape it somehow? Here's the example..echo "<title>The Shattered Realms ~ Ush'en: $r[header]</title>";Is that good enough or will that cause me problems? Link to comment Share on other sites More sharing options...
jlhaslip Posted January 12, 2007 Share Posted January 12, 2007 http://www.htmlhelp.com/reference/html40/e...es/special.html‘ = ‘the w3schools reference page says there is a problem using the apostrophe code in an IE browser, so maybe use the one above???http://www.w3schools.com/tags/ref_entities.asp' apostrophe ' (does not work in IE) ' Link to comment Share on other sites More sharing options...
justsomeguy Posted January 15, 2007 Share Posted January 15, 2007 You only need to escape a quote in a string if the quote is the same quote that encloses the string. So, a double-quoted string would need to escape double-quotes:echo "This string contains \"double quotes\" and 'single quotes'";And a single-quoted string would need to escape single-quotes:echo 'This string contains "double quotes" and \'single quotes\''; Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now