calmchess Posted June 1, 2010 Share Posted June 1, 2010 the follwing for loop loops through an array containing strings.....i need to loop through the array and combine the strings into a single string........How should i do this? please use a for loop as the array's length is dynamic for($j=0;$j<count($arr2);$j++){ $arr_ser =$arr2[$j].":"; } Link to comment https://forums.phpfreaks.com/topic/203474-for-loop-combine-array-into-single-string/ Share on other sites More sharing options...
shino Posted June 1, 2010 Share Posted June 1, 2010 Like this? $string = implode(':', $arr2); echo $string; Link to comment https://forums.phpfreaks.com/topic/203474-for-loop-combine-array-into-single-string/#findComment-1065934 Share on other sites More sharing options...
calmchess Posted June 1, 2010 Author Share Posted June 1, 2010 thanks that worked Link to comment https://forums.phpfreaks.com/topic/203474-for-loop-combine-array-into-single-string/#findComment-1065938 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.