How to place multiple white space between two strings?

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
szms
Forum Contributor
Posts: 101
Joined: Thu Jun 26, 2003 12:23 pm

How to place multiple white space between two strings?

Post 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?
Drachlen
Forum Contributor
Posts: 153
Joined: Fri Apr 25, 2003 1:16 am

Post by Drachlen »

echo "$var1  $var2";
two spaces inbetween..
User avatar
nigma
DevNet Resident
Posts: 1094
Joined: Sat Jan 25, 2003 1:49 am

Post by nigma »

Or
print "<pre>$var1 $var2</pre>";
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post by m3rajk »

or

Code: Select all

echo <<<END
$var1



$var2
END;
(but that one display right in html)
Moonspell
Forum Newbie
Posts: 21
Joined: Tue May 13, 2003 4:54 pm

Post by Moonspell »

print $var1."&nbsp\; ".$var2;

I believe you need the \ for the ;
Coco
Forum Contributor
Posts: 339
Joined: Sat Sep 07, 2002 5:28 am
Location: Leeds, UK
Contact:

Post by Coco »

wasnt aware ; had to be escaped in strings
thought it was just ' " and $
Post Reply