harlequeen Posted July 12, 2008 Share Posted July 12, 2008 Hi I am trying to get a name to echo to the screen using the following code. echo ($myrow["Firstname"].$myrow ["Surname"]); but this does not allow me to put a space in between the two names. I have tried adding a space after the field name "Firstname" or before "Surname" but this does not work. (presumably because the field names are different then?) How do I do this please? regards Harlequeen Link to comment https://forums.phpfreaks.com/topic/114431-solved-concatenation/ Share on other sites More sharing options...
JasonLewis Posted July 12, 2008 Share Posted July 12, 2008 Like so: echo $myrow['Firstname']." ".$myrow['Surname']; Link to comment https://forums.phpfreaks.com/topic/114431-solved-concatenation/#findComment-588416 Share on other sites More sharing options...
harlequeen Posted July 13, 2008 Author Share Posted July 13, 2008 Thanks, I thought I had tried all the combinations of "" and spaces I could think of. Cheers Harlequeen Link to comment https://forums.phpfreaks.com/topic/114431-solved-concatenation/#findComment-588920 Share on other sites More sharing options...
.josh Posted July 13, 2008 Share Posted July 13, 2008 or you can do this: echo "{$myrow['Firstname']} {$myrow['Surname']}"; I'm kind of surprised you didn't at least do this though: echo $myrow['Firstname']; echo " "; echo $myrow['Surname']; Link to comment https://forums.phpfreaks.com/topic/114431-solved-concatenation/#findComment-588932 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.