|
Posted by Hendri Kurniawan on 04/19/07 21:45
laredotornado@zipmail.com wrote:
> Hi,
>
> Using PHP 4.4.4, I have this array
>
> $my_arr = array("a", "b", "c", "d");
>
> What is the easiest way to insert the element "|" between the elements
> of the array so that the result is
>
> array("a", "|", "b", "|", "c", "|", "d");
>
> ? Thanks, - Dave
>
Easiest, IMHO $my_arr = explode(',', implode(',|,', $my_arr));
But someone in this NG bound to find a better way to do it :D
Hendri Kurniawan
Navigation:
[Reply to this message]
|