Array to string


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2.  
  3. $array = array( [0] => "value 1", [1] => "value 2" );
  4. $output = implode( ",", $array );
  5. echo $output;
  6.  
  7. # This will output:
  8. # value 1,value 2

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.