Page 1 of 1

converting array into a string

Posted: Mon Nov 08, 2004 4:59 am
by pelegk2
i have an array
say : (3,"435",5,886,"sdr");
can i some how convert it to one string with delimiters say like :
"3,435,5,886,sdr"
??

Posted: Mon Nov 08, 2004 5:05 am
by emperor
Try using [php_man]implode[/php_man] - eg...

Code: Select all

<?php
    $array = array (3, '435', 5, 886, 'sdr');
    $string = implode (',', $array);
?>

Posted: Mon Nov 08, 2004 5:13 am
by pelegk2
thansk alot