Reply to Re: inserting elements within an array

Your name:

Reply:


Posted by Rami Elomaa on 04/21/07 13:02

Hendri Kurniawan kirjoitti:
> FFMG wrote:
>> laredotornado@zipmail.com;61127 Wrote:
>>> On Apr 19, 4:45 pm, Hendri Kurniawan <ask...@email.com> wrote:
>>>> laredotorn...@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
>>> Beautiful! Concise and accurate. I have given your post the highest
>>> rating on Google Groups. - Dave
>>
>> Ah, Google Groups, there goes the 'why' part.
>>
>> FFMG
>>
>>
>
>
> ?? why?
>

See Geoff's post: "The question is /why/ does he want to do it?"

What FFMG is suggesting is that if a person thinks 'google groups' ==
'usenet' then they'll propably be asking silly questions too.

--
Rami.Elomaa@gmail.com

"Wikipedia on vähän niinq internetin raamattu, kukaan ei pohjimmiltaan
usko siihen ja kukaan ei tiedä mikä pitää paikkansa." -- z00ze

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация