Php > Arrays
How to remove any NULL values from an array
How to remove any NULL values from an array /* * nas_array_remove_null -- remove any NULL values from an array * Description: * array nas_array_remove_null(array $somearray) */ function nas_array_remove_null($somearray) { if (is_array($somearray)) { $jmlarray = count($somearray)-1; for ($i=0; $i <= $jmlarray; $i++) { if ($somearray[$i] != NULL) { $myarray[] = $somearray[$i]; }; }; return $myarray; } else { exit; }; }; ?>
Php Codes
Algorithms
Arrays
Authentication
Calendar
Code Snippets
Programs
Content Manage
Contest Related
Cookies
Credit Cards
DBase Related
Databases
Date Time
Directories
E-Mail
Errors
File
File System
Forms
Handling
Graphics
HTML and PHP
Informix
Ingres
InterBase
LDAP
Look and Feel
Miscellaneous
MySQL
Other
PHP Classes
Searching
Navigation
Statistics
Strings
User Manage