Sleeper Posted April 6, 2008 Share Posted April 6, 2008 If I have $a = 1 $b = 00 How would I place the two together to make 100? $a$b didnt work..lol I know im a nube just not sure how I would be able to put to var together to read as one. Link to comment https://forums.phpfreaks.com/topic/99854-solved-var-wright/ Share on other sites More sharing options...
GingerRobot Posted April 6, 2008 Share Posted April 6, 2008 You need the concatenation operator (.). It joins strings together. <?php $a = 1; $b = 00; echo $a.$b; ?> Link to comment https://forums.phpfreaks.com/topic/99854-solved-var-wright/#findComment-510683 Share on other sites More sharing options...
Sleeper Posted April 6, 2008 Author Share Posted April 6, 2008 thank you. Link to comment https://forums.phpfreaks.com/topic/99854-solved-var-wright/#findComment-510695 Share on other sites More sharing options...
Barand Posted April 6, 2008 Share Posted April 6, 2008 $b needs to be a string otherwise it is treated as just 0 <?php $a = '1'; $b = '00'; echo "$a$b"; //or echo $a.$b; ?> Link to comment https://forums.phpfreaks.com/topic/99854-solved-var-wright/#findComment-510699 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.