PDA

View Full Version : what charaters do I escape?


[m]
05-12-2003, 05:04 AM
if I was going to print a line like
<TD style="width:114px;margin:5;" valign="top">
would I have to escape the simicolon?
or could you just give me a complete list of charaters I would have to escape?

thanx

missing-score
05-12-2003, 07:28 AM
No. You dont have to escape colons.

pardicity3
05-12-2003, 09:24 PM
http://www.php.net/manual/en/language.types.string.php

duniyadnd
05-13-2003, 05:26 AM
above example


echo "<TD style=\"width:114px;margin:5;\" valign=\"top\">";

bored
05-16-2003, 07:52 AM
If you want to echo javascript you have to 'double-escape' the escape characters.

Example:


echo("<script>alert(\"This is line one.\\r\\nThis is like two.\");</script>

You're actually escaping the escape character for javascript so it can process it correctly.

Word.

Also, if you use single quotes for echoing out madness, you don't have to escape the double quotes, but you cant include variables in the quoted clause.

Example:

echo('Man I was at work one day and
some dude yelled "Hey man, you suck!"
across the room and got fired twice.'
.$some_antics .' Yeah!');