|
Posted by Rik on 08/21/06 14:14
nescio wrote:
> hello,
>
> i have two array;
>
> one is of the type:
> $a = array('a','b','c','d');
>
> i place this array in an associative array like:
>
> $b = array('some_key' => 'hello ; ' . $a);
That cannot be done, you cannot concatenate an array to a string.
> (so the value has some text then a ';' and then the array)
No, it has the text 'Array', and usually an error is logged.
Use:
$b = array('some_key' => array('text' = 'hello ;', 'array' = $a));
or perhaps:
$b = array('some_key' => array_merge(array('hello'),$a));
depending on your needs.
Then you've preserved the array.
Alternatively, you could serialize() your array, but I don't see the point.
Grtz,
--
Rik Wasmus
Navigation:
[Reply to this message]
|