note 13404 deleted from function.array-pop by didou

From: Date: Tue, 29 Jul 2003 11:56:15 +0000
Subject: note 13404 deleted from function.array-pop by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-52909@lists.php.net to get a copy of this message
Note Submitter: gold@NOSPAM.babel.com.au ---- I had a situation where the LDAP function I was passing the array to died if there where empty key/val pairs. I was looking here thinking that I could move the key/val to the end of the array and pop it off seeing as there wasn't any way I could find in the array_ functions of popping the pair out of the middle. The final solution was much simplier with hindsight so I've added it here. Hope it helps someone. foreach ($info as $key=>$val) { if ($val == "") { unset($info[$key]); } } Regards, Au.

« previous php.notes (#52909) next »