jmurch Posted October 17, 2007 Share Posted October 17, 2007 I am trying to select a group of records from a database and concatonate the results to a string. The start and end strings will be static but the string(s) between are from an array. Does anyone have a suggestion on the best way to approach this? while ($row = mysql_fetch_assoc($content)) { $id = $row['id']; $text = $row['text']; } $full_string = "start".$array_contents."end" Thanks Quote Link to comment https://forums.phpfreaks.com/topic/73581-solved-help-concat-strings/ Share on other sites More sharing options...
trq Posted October 17, 2007 Share Posted October 17, 2007 <?php $full_string = "start" . implode("", $array_contents) . "end"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/73581-solved-help-concat-strings/#findComment-371254 Share on other sites More sharing options...
jmurch Posted October 17, 2007 Author Share Posted October 17, 2007 Thanks Thorpe!!! Quote Link to comment https://forums.phpfreaks.com/topic/73581-solved-help-concat-strings/#findComment-371255 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.