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--

Recommended Answers

All 2 Replies

Hmmmm, show us what you've got so we can help you with it.

Member Avatar for diafol

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().

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.