Array to String

Reply

Join Date: Jul 2004
Posts: 3
Reputation: janzaldo is an unknown quantity at this point 
Solved Threads: 0
janzaldo janzaldo is offline Offline
Newbie Poster

Array to String

 
0
  #1
Jul 16th, 2004
is there any function that converts the values of an array to string?
i tried with array_values but i dont know how
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 1,135
Reputation: samaru is just really nice samaru is just really nice samaru is just really nice samaru is just really nice 
Solved Threads: 6
Team Colleague
samaru's Avatar
samaru samaru is offline Offline
a.k.a inscissor

Re: Array to String

 
0
  #2
Jul 17th, 2004
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]
Check out my blog at http://www.shinylight.com for more stuff about web dev.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC