PHP escape chars

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bootneck
Forum Newbie
Posts: 3
Joined: Sun Mar 15, 2009 2:26 pm

PHP escape chars

Post 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?
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: PHP escape chars

Post 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.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
bootneck
Forum Newbie
Posts: 3
Joined: Sun Mar 15, 2009 2:26 pm

Re: PHP escape chars

Post 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.
bootneck
Forum Newbie
Posts: 3
Joined: Sun Mar 15, 2009 2:26 pm

Re: PHP escape chars - Solved

Post 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.
Post Reply