You are here: Challenging Arrays « PHP Programming Language « IT news, forums, messages
Challenging Arrays

Posted by James Perih on 03/12/07 05:29

Hi ya'll;

Consider this array:

$xmlData = array (
'slideshow' => array ('settings' => array ( 'image_folder' =>
'ads/', 'time' => '1', 'fade' => '2', 'repeat' => 'true', 'captions'
=> 'false',),
'images' => array ('image' => array (
0 => array ('file' => '1.jpg', 'caption' => 'Series #1',),
1 => array ('file' => '2.jpg', 'caption' => 'Series #2',),
2 => array ('file' => '3.jpg', 'caption' => 'Series #3',),
),
),
),
);

I've chosen *not* to use SimpleXML for xml processing -- our webhost
won't upgrade his php beyond some early 5.x build, and not all
SimpleXML functions are in there (like, addChild()). So, I'm using a
different library.

Anyway, basically, what my question is that, how can I write one
"settings" array as it is, and then add new [files][file] arrays to
the structure, but the number of those will vary (based on previous
pages' dynamically-generated <form> code as

<input type="text" name="file[]"> </input>
<input type="text" name="file[]"> </input>
<input type="text" name="file[]"> </input>
... (could be dozens)

I can get the values, of course... how how to I add the array
structure to the above array programatically?

 

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

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