Reply to Re: Parse arrays.

Your name:

Reply:


Posted by Captain Paralytic on 07/30/07 15:39

On 30 Jul, 16:14, 1956col <prash.ma...@gmail.com> wrote:
> hi all,
> have a simple problem,
> my array is :-
>
> $c = array(
> "2" => array(
> "id" => "2",
> "name" => "Sport",
> "children" => array(
> "4" => array(
> "id" => "4",
> "name" =>
> "Archery",
> "children" =>
> "",
> ),
>
> "5" => array(
> "id" => "5",
> "name" =>
> "Badminton",
> "children" =>
> "",
> ),
> ),
> ),
>
> );
>
> and i want to convert this to
>
> $options = array(
> 'Sports' =>array(
> '3' => 'Archery',
> '4' => 'Badminton',
> ),
> );
>
> Where 3 & 4 are the keys foe Archey & Badminton resp.
> I am a newbie to PHP
> getting so many problems solving this,
> Any help appriciated.

Is your rule for converting the "id" value to the new keys

array key = id value - 1

[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

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