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
alisaWL
Forum Newbie
Posts: 4 Joined: Tue Jun 30, 2009 5:03 am
Post
by alisaWL » Tue Jun 30, 2009 5:09 am
I have some strange behavior on this very simple test case:
Code: Select all
<?php
echo 'single: my \n \$ \t string';
echo '<br/>';
echo "double: my \n \$ \t string";
?>
Code: Select all
output:
single: my \n \$ \t string
double: my $ string
What am I missing?
Shouldn't there be a
newline and a
tab in the double quote string?
Thank you.
Last edited by
Benjamin on Tue Jun 30, 2009 10:34 am, edited 1 time in total.
Reason: Changed code type from text to php.
jayshields
DevNet Resident
Posts: 1912 Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England
Post
by jayshields » Tue Jun 30, 2009 5:50 am
You won't see the effect of a new line or a tab in your browsers viewport. You will see it in the source code though.
You can change this by using the <pre> HTML tag.