note 99579 added to function.array-intersect-ukey

From: Date: Wed, 25 Aug 2010 09:08:27 +0000
Subject: note 99579 added to function.array-intersect-ukey
Groups: php.notes 
Request: Send a blank email to php-notes+get-172036@lists.php.net to get a copy of this message
Using PHP Version 5.2.9-2 on Win 32 For those wondering what happens with numeric keys, here's a short example that might save you time : $a=array(1=>'a',2=>'b',3=>'c'); $b=array(2=>'z',3=>'c',4=>'d'); $c=array_intersect_key($a,$b); print_r($c); Will output Array ( [2] => b [3] => c ) It works fine, if values are different, the first array's ones are retained. ---- Server IP: 69.147.83.197 Probable Submitter: 92.140.116.138 ---- Manual Page -- http://www.php.net/manual/en/function.array-intersect-ukey.php Edit -- https://master.php.net/note/edit/99579 Del: integrated -- https://master.php.net/note/delete/99579/integrated Del: useless -- https://master.php.net/note/delete/99579/useless Del: bad code -- https://master.php.net/note/delete/99579/bad+code Del: spam -- https://master.php.net/note/delete/99579/spam Del: non-english -- https://master.php.net/note/delete/99579/non-english Del: in docs -- https://master.php.net/note/delete/99579/in+docs Del: other reasons-- https://master.php.net/note/delete/99579 Reject -- https://master.php.net/note/reject/99579 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#172036) next »