PHPBuilder - Array Cleaner



RSS Twitter
Snippets Other

Array Cleaner

by: Gary Malcolm
|
April 29, 2002

Version: 1.0.1

Type: Function

Category: Other

License: GNU General Public License

Description: Takes an array that contains ""-values and strips the key from them, in other words, it cleans the array.



function array_clean($array){
        foreach($array as $key => $value){
		if($value != ""){
			if(is_array($value)){ 
				if(!($value = array_clean($value)) ){ 
					continue;
				}
			}
			$newarray[$key] = $value;
		}
	}
	return($newarray);
}

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
Gary Malcolm

Comment:



Comment:

(Maximum characters: 1200). You have characters left.