Jump to content

Unsettling lack of results from unset()


HalfNote5

Recommended Posts

Inside a foreach/as loop, in a nested if loop I have this little nugget:

 

 

 

 else
                       {
                       $currentRec = current($r);    
                       echo "Rec to Kill: $currentRec"; //Testing purposes only - Killing the right thing?
                       unset($r[$currentRec]);
                       }

 

 

It's not working as I'd expect it to (which would be to kill the current record of my 2d array).

 

Of course, I'm a PHP novice, (more used to working with dbase/foxpro) so there's something in transitioning to PHP's logic that I'm most definitely missing. A nudge in the right direction would be lovely.

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/275331-unsettling-lack-of-results-from-unset/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.