Verbat Posted January 21, 2008 Share Posted January 21, 2008 I have to var, $one and $two. I want to display them together like this $one$two but it doesnt let me. How can it be done? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/87019-its-a-simple-one-i-bet/ Share on other sites More sharing options...
adam291086 Posted January 21, 2008 Share Posted January 21, 2008 you need to do something like <?php echo $var1.$var2; ?> Use the "." to join two variables together. Quote Link to comment https://forums.phpfreaks.com/topic/87019-its-a-simple-one-i-bet/#findComment-444977 Share on other sites More sharing options...
Verbat Posted January 21, 2008 Author Share Posted January 21, 2008 Well, i forgot to say that the var has numbers in it so it just shows 9.0 for example. :| Quote Link to comment https://forums.phpfreaks.com/topic/87019-its-a-simple-one-i-bet/#findComment-444980 Share on other sites More sharing options...
adam291086 Posted January 21, 2008 Share Posted January 21, 2008 ok well like this then <?php echo $var1".".$var2; ?> Quote Link to comment https://forums.phpfreaks.com/topic/87019-its-a-simple-one-i-bet/#findComment-444981 Share on other sites More sharing options...
Nhoj Posted January 21, 2008 Share Posted January 21, 2008 Try: <?php echo 'this is var 1: '.$var1.' and this is var 2: '.$var2; ?> You could also do: <?php echo $var1.''.$var2; ?> Or even: <?php echo "{$var1} {$var2}"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/87019-its-a-simple-one-i-bet/#findComment-444982 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.