Page 1 of 1
strings and whitespaces
Posted: Wed Jul 03, 2002 10:53 am
by Phraglord
Hi there !
$mystring = " ";
print "mystring = [" . $mystring . "]";
The output of the print function is : mystring = [ ]
Why does it show only one of the spaces ?
thx !
Posted: Wed Jul 03, 2002 11:04 am
by RandomEngy
What other space? mystring only has one space.
Re: strings and whitespaces
Posted: Wed Jul 03, 2002 12:01 pm
by protokol
Phraglord wrote:Hi there !
$mystring = " ";
print "mystring = [" . $mystring . "]";
The output of the print function is : mystring = [ ]
Why does it show only one of the spaces ?
thx !
Use the code tags to display the code you are trying to use. It saves all your formatted text.
Posted: Thu Jul 04, 2002 3:38 am
by Wayne
If you are refering to why the HTML output only displays 1 of the spaces, this is because HTML formatting ingores whitespace. It will only display 1 space no matter how many you put in. If you want to keep the formatting either replace each space with or else enclose what you want displayed within a
tag. If you use the <pre> tag though you will not be able to do HTML formatting on the text.
Hope that helps.
Posted: Fri Jul 05, 2002 4:56 am
by Phraglord
thx !