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
[Back to original message]
|