FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » arrays with holes
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
arrays with holes [message #176741] Fri, 20 January 2012 20:42 Go to previous message
cate is currently offline  cate
Messages: 12
Registered: January 2012
Karma:
Junior Member
still! a php newbie. This is kind of a touch base question. I think
I have it...

I have an indexed array in which I progressively remove elements with

unset($my_array[$index]);

This leave "holes", which I'm ok with.

To now find the 5th element in this shot-up array I use

$my_array_piece = array_splice($my_array, 5, 1);

Is that how you "do" it?

Unfortunately, the "indexes" have meaning. I don't want to repack.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Parsing .css files with php: Cons?
Next Topic: Open Source Customization
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 14:33:05 GMT 2024

Total time taken to generate the page: 0.04521 seconds