note 43527 deleted from function.array-combine by aidan

From: Date: Sat, 26 Jun 2004 07:35:45 +0000
Subject: note 43527 deleted from function.array-combine by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-71733@lists.php.net to get a copy of this message
Note Submitter: romrom38@yahoo.fr ---- This function is the PHP4 replacement PHP function for array_combine (PHP5). function assoc_key_val($a_keys,$a_values) { if(!is_array($a_keys)) $a_keys = array(); if(!is_array($a_values)) $a_values = array(); $keys = array_merge($a_keys); $vals = array_values($a_values); $ret = array(); foreach($keys as $key) { list($unused,$val) = each($vals); $ret[$key] = $val; } return $ret; } It could be usefull for someone who wants to make an array_intersect() on an associative array. Romain FABBRI (FRANCE)

« previous php.notes (#71733) next »