Page 1 of 1

How to place multiple white space between two strings?

Posted: Fri Aug 15, 2003 9:30 pm
by szms
Hi there!!

Here is my two string variables:
$var1 = "Monday";
$var2 = "Friday";

I want to print $var1 & $var2 so that there will be two white space in between.
i.e. Monday Friday
Can you plase help me?

Posted: Fri Aug 15, 2003 10:55 pm
by Drachlen
echo "$var1  $var2";
two spaces inbetween..

Posted: Sat Aug 16, 2003 12:11 pm
by nigma
Or
print "<pre>$var1 $var2</pre>";

Posted: Sat Aug 16, 2003 2:57 pm
by m3rajk
or

Code: Select all

echo <<<END
$var1



$var2
END;
(but that one display right in html)

Posted: Sat Aug 16, 2003 10:10 pm
by Moonspell
print $var1."&nbsp\; ".$var2;

I believe you need the \ for the ;

Posted: Sun Aug 17, 2003 6:34 am
by Coco
wasnt aware ; had to be escaped in strings
thought it was just ' " and $