For a one dimensional array, use the implode() function:
[php]
$array = array('lastname', 'email', 'phone');
$comma_separated = implode(",", $array);
echo $comma_separated; // lastname,email,phone
[/php]
samaru
a.k.a inscissor
1,256 posts since Feb 2002
Reputation Points: 262
Solved Threads: 18
Implode function does the trick for me. Here an example that I followed:
<?php
$array = array('lastname', 'email', 'phone');
$comma_separated = implode(",", $array);
echo $comma_separated; // lastname,email,phone
?>
nanosani
Unauthenticated Liar
1,830 posts since Jul 2004
Reputation Points: 45
Solved Threads: 56
See split() .
Next time please start a new thread.
pritaeas
Posting Expert
5,480 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875