note 60676 deleted from function.array-merge by bjori

From: Date: Mon, 24 Apr 2006 20:28:28 +0000
Subject: note 60676 deleted from function.array-merge by bjori
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-109609@lists.php.net to get a copy of this message
Note Submitter: j_oaquimsilva at yahoo dot com dot br ---- function array_merge_sim ($arr1, $arr2) { $i=0; $adid_arrayS = array(); foreach ($arr1 as $x) { $j=0; $nr1=count($arr1); $nr2=count($arr2); foreach ($arr2 as $z) { if($x==$z){ array_push($adid_arrayS,$z); if($nr2==($j+1)) array_pop($arr2); else array_splice($arr2, $j,-($nr2-$j-1)); if($nr1==($i+1)) array_pop($arr1); else array_splice($arr1, $i,-($nr1-$i-1)); $i--; }else $j++; } $i++; } return array_merge($adid_arrayS,$arr1,$arr2); }

« previous php.notes (#109609) next »