You are here: Array question « All PHP « IT news, forums, messages
Array question

Posted by Captain Dondo on 06/15/05 05:00

I have an array like this:

Array
(
[0] => Array
(
[0] => http://www.seiner.com/blog/Travels/images/05164065208.jpg
[1] => 136
)

[1] => Array
(
[0] => http://www.seiner.com/blog/Travels/images/05164065131.jpg
[1] => 565
)

[2] => Array
(
[0] => http://www.seiner.com/blog/Travels/images/05164065208.jpg
[1] => 993
)

[3] => Array
(
[0] => http://www.seiner.com/blog/Travels/images/05164065131.jpg
[1] => 1422
)

)

I want to rotate the first element of each sub-array while leaving the
second element intact, to get the following result:

Array
(
[0] => Array
(
[0] => http://www.seiner.com/blog/Travels/images/051
[1] => 1442
)

[1] => Array
(
[0] =>
http://www.seiner.com/blog/Travels/images/jpg
[1] => 136
)

[2] => Array
(
[0] =>
http://www.seiner.com//images/05164065208.jpg
[1] => 565
)

[3] => Array
(
[0] =>
http://ww/blog/Travels/images/05164065131.jpg
[1] => 993
)

)

In other words, I need to pop the first element of each subarray and
unshift it to be the first element, while leaving the second element in
place....

I've been playing with various combinations of array_pop, array_unset, and
so on but I am complete PHP newbie and I am throughly stuck....

TIA...

--

use munged address above to email me
SpamTrap DoMeNow@seiner.com

 

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

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