JesúsCristo Posted March 14, 2007 Share Posted March 14, 2007 Would anyone know how to print just the values of the array separated by commas? So if I have an array, $array = ("hello","to","you","there"); I would get // hello, to, you, there Much thanks! Link to comment https://forums.phpfreaks.com/topic/42761-solved-print-array-values-simple/ Share on other sites More sharing options...
per1os Posted March 14, 2007 Share Posted March 14, 2007 print "<pre>"; print_r($array); print "</pre>"; Link to comment https://forums.phpfreaks.com/topic/42761-solved-print-array-values-simple/#findComment-207529 Share on other sites More sharing options...
artacus Posted March 14, 2007 Share Posted March 14, 2007 <?php $array = ("hello","to","you","there"); echo implode(', ', $array); Link to comment https://forums.phpfreaks.com/topic/42761-solved-print-array-values-simple/#findComment-207537 Share on other sites More sharing options...
JesúsCristo Posted March 14, 2007 Author Share Posted March 14, 2007 Ah, thanks to both of you for the help! I should learn more about these functions. Thanks again! Link to comment https://forums.phpfreaks.com/topic/42761-solved-print-array-values-simple/#findComment-207539 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.