irwan

Create comma separated list from array

Nov 15th, 2011
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.18 KB | None | 0 0
  1. <?php
  2. //create a comma separated list from an array
  3. $array = array('green','purple','blue','yellow','amber','red');
  4. $comma_separated = implode(",", $array);
  5. echo $comma_separated;
  6. ?>
  7.  
Advertisement
Add Comment
Please, Sign In to add comment