Ok,
You can either...
<? $space= " "; $somevar= "test"; ?>
<? echo $somevar, $space, $somevar; ?>
or
<? $somevar="test"; ?>
<? echo $somevar, " ", $somevar; ?>
To get a space between variables right? Is there any other way?
Thanks, Doug
echo "{$thisvar} {$thatvar} {$anothervar}<br/>{$whatevervar}";
Some one correct me if Im wrong, but wouldnt the following work???
<? $somevar = "test"; echo = "$somevar $somevar"; ?>
echo $blah." ".$blah2;
$blah="Blah "; //notice the space
And just to round the menagerie off:
<?php echo $foo?> <?php echo $bar?>
just remember when you're playing with that it will stop the line from wrapping in the browser window.
Originally posted by GreyBoy Some one correct me if Im wrong, but wouldnt the following work??? <? $somevar = "test"; echo = "$somevar $somevar"; ?> [/B]
Originally posted by GreyBoy Some one correct me if Im wrong, but wouldnt the following work???
[/B]
I don't know why but it isn't leaving that space in when I use comma's and a space between variables...
this 1 will give u an error coz of the equal "=" sign u add from your echo
<? $somevar = "test"; echo = "$somevar $somevar"; ?> [code=php] but this 1 will do. [code=php] <? $somevar = "test"; echo "$somevar $somevar"; ?> [code=php]
Originally posted by maske I don't know why but it isn't leaving that space in when I use comma's and a space between variables...
because thats not right....
echo $var $var2 $var3;
should space it out if I'm not mistaken...
or echo "$var $var2 $var3"; as was previously posted would work also....
or any other number of ways that was posted beforehand 🙂
Originally posted by osusano this 1 will give u an error coz of the equal "=" sign u add from your echo <? $somevar = "test"; echo = "$somevar $somevar"; ?> [code=php] but this 1 will do. [code=php] <? $somevar = "test"; echo "$somevar $somevar"; ?> [code=php] [/B][/QUOTE] lol yeah, that was just a mistake. ;)
Originally posted by osusano this 1 will give u an error coz of the equal "=" sign u add from your echo
<? $somevar = "test"; echo = "$somevar $somevar"; ?> [code=php] but this 1 will do. [code=php] <? $somevar = "test"; echo "$somevar $somevar"; ?> [code=php] [/B][/QUOTE] lol yeah, that was just a mistake. ;)