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! Quote 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>"; Quote 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); Quote 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! Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.