try serialize function
http://us2.php.net/serialize
it's easy to switch back to array again.
small addition to Niels'post
array 2 string - implode (http://us2.php.net/implode)
string to array - explode (http://us2.php.net/explode)
-afan
> string implode(string glue, array pieces) [1]
>
> Regar
string implode(string glue, array pieces) [1]
Regards,
Niels
[1] http://php.net/manual/en/function.implode.php
> Pardon my ignorance and lack of ability to form the right search for
> google, but I'm trying to figure out if there's a simple function in
> PHP to convert array values to a string w
Pardon my ignorance and lack of ability to form the right search for
google, but I'm trying to figure out if there's a simple function in PHP
to convert array values to a string with a separator for each value.
eg.
$arr = array(1, 5, 2);
$str = ($arr, ',');
print $str; # "1,5,2"
Thanks for y
3 matches
Mail list logo