Page 1 of 1

PHP escape chars

Posted: Sat Jun 19, 2010 6:24 am
by bootneck
Hi,
My code appears to be ignoring tabs i.e
echo "A \t B \t \t C";
simply outputs A B C

where am I going wrong?

Re: PHP escape chars

Posted: Sat Jun 19, 2010 11:52 am
by AbraCadaver
In HTML any whitespace: tabs, newlines multiple spaces are treated as 1 space. You'll either need to display it as text or use several   for a tab.

Re: PHP escape chars

Posted: Sat Jun 19, 2010 2:04 pm
by bootneck
I was referring to a php string and the following:-

http://www.php.net/manual/en/language.t ... tax.double

That's either wrong or I'm most possibly misreading it.

Re: PHP escape chars - Solved

Posted: Sat Jun 19, 2010 3:57 pm
by bootneck
Hi,

I forgot to enclose the code with the <pre></pre> tags

So:-

$mystring = "A \t B \t C \t";

expands A B C with tabs.