You are here: array key reassignment methodology « PHP Programming Language « IT news, forums, messages
array key reassignment methodology

Posted by PhilM on 08/12/05 04:39

I would like some assistance in methodology to reassign/reset array keys to
consecutive numbering, while keeping in sync a second array that uses the
key of the first as it's key set.

If I have read a solution on php.net, I didn't understand what I was
reading.
At this stage of bumbling around, I am getting rather confused/frustrated.
...and getting mind around multidimensional arrays hurts :)

*** note php4 only available ***
$links is used to generate main page links.
$gallery is used to generate links on the $links page that has the same key
value.

The output below was produced using my config generator form, which enables
adding/deletion of links and associated galleries, which accounts for the
gaps in the $links key.

///// LINK LIST (TOP OF PAGE LINKS) /////
$links[0]=array('home'=>'Home');
$links[1]=array('service'=>'Services');
$links[3]=array('people'=>'Portraits');
$links[5]=array('fundraise'=>'Fundraise');
$links[6]=array('events'=>'Events');
$links[7]=array('contact'=>'Contact');
///// GALLERY LIST /////
$gallery[0]=array('service'=>'Service','reception'=>'Reception');
$gallery[3]=array('family'=>'Family','children'=>'Children','adults'=>'Adult
s');
$gallery[5]=array('cards'=>'Cards','leaflets'=>'Leaflets');

 

Navigation:

[Reply to this 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

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