This is weird.
I have items in an inventory with images for them on a server. I am trying to list items that have no image. So I am building two arrays and then finding the difference between them.
This works, but is just too slow...
<?
//$images and $items are fine as arrays in themelves
for ($i=0,$n=count($items);$i<$n;$i++){
$found = false;
for ($j=0,$m=count($images);$j<$m;$j++){
if ($items[$i] == $images[$j]) {
$found = true;
break;
}
}
if ($found == false) {
$items_missing_images[] = $diamonds[$i];
}
}
?>
But if I simply send the two arrays through array_diff then I get an array of the same length (!!!), but many of the items are blank! 😕
What is even weirder is that when I use array_diff to find images with no items it works beautifully. I have all the same code beforehand!
???
Does this make any sense?
Thanks to anyone who decides to help if they can,
-Marc