Bug #15574: Strip out array keys with no value
| From: | zakstergrant at hotmail dot com | Date: | Fri, 15 Feb 2002 17:28:54 +0000 |
| Subject: | Bug #15574: Strip out array keys with no value | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-372@lists.php.net to get a copy of this message | ||
From: zakstergrant@hotmail.com
Operating system: Linux Mandrake 8.2b2
PHP version: 4.1.1
PHP Bug Type: Feature/Change Request
Bug description: Strip out array keys with no value
Is it possible to add a function which strips out all parts of an array
which don't have a value? I ask this simply because I'm trying to
array_diff a submitted form against a set of required fields, and my test
machine (Win2K/IE5) sends all empty form elements over in an array (I use
NAME="FormData[Bar]", NAME="FormData[Baz]", etc) with empty values, and
PHP puts them into my form array.
It'd be great if I could say "array_strip_empty($myarray)" and PHP took
out all values which are "" (empty)
Thanks,
~ZG~
--
Edit bug report at http://bugs.php.net/?id=15574&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=15574&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=15574&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=15574&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=15574&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=15574&r=support
Expected behavior: http://bugs.php.net/fix.php?id=15574&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=15574&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=15574&r=submittedtwice