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 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"; ?> 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!!! Link to comment https://forums.phpfreaks.com/topic/73581-solved-help-concat-strings/#findComment-371255 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.