unemployment Posted February 23, 2011 Share Posted February 23, 2011 How do I add a space in my concatenation? What I have down below doesn't work. $result[0] .$result[1] Quote Link to comment Share on other sites More sharing options...
Adam Posted February 23, 2011 Share Posted February 23, 2011 $result[0] . ' ' . $result[1] Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted February 23, 2011 Share Posted February 23, 2011 To add a space, you have to type a literal space enclosed in quotes. <?php $str = $result[0] . ' ' . $result[1]; ?> Ken Quote Link to comment Share on other sites More sharing options...
isedeasy Posted February 23, 2011 Share Posted February 23, 2011 echo $result[0] . ' ' . $result[1]; echo "{$result[0]} {$result[1]}"; Quote Link to comment Share on other sites More sharing options...
unemployment Posted February 23, 2011 Author Share Posted February 23, 2011 Thanks. I know that was an easy one. Quote Link to comment 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.