0

I would like to create a loop where it will count down and shift every thing to the right by one postion in the array. for example: array('1a','1b','1c','','','1f')

should look like this
array('1a','','','1b','1c','1f')
Starting from position 5 and counting down.$i--

3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by diafol
0

Your description doesn't make much sense to me. shifting everything to the right by one position won't give you the array you describe. Why are the blanks after the 1a item?
If you want to get rid of the blanks entirely, you can use array_filter().

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.