Voting

: six plus three?
(Example: nine)

The Note You're Voting On

189780 at gmail dot com
15 years ago
Actually array_intersect finds the dublicate values, here is my approach which is 5 times faster than built-in function array_intersect().. Give a try..

<?php
function my_array_intersect($a,$b)
{
for(
$i=0;$i<sizeof($a);$i++)
{
$m[]=$a[$i];
}
for(
$i=0;$i<sizeof($a);$i++)
{
$m[]=$b[$i];
}
sort($m);
$get=array();
for(
$i=0;$i<sizeof($m);$i++)
{
if(
$m[$i]==$m[$i+1])
$get[]=$m[$i];
}
return
$get;
}
?>

Barış ÇUHADAR
[email protected]

<< Back to user notes page

To Top