Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/239.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在数组中查找不在其他数组中的值?_Php_Arrays_Array Difference - Fatal编程技术网

Php 在数组中查找不在其他数组中的值?

Php 在数组中查找不在其他数组中的值?,php,arrays,array-difference,Php,Arrays,Array Difference,这并不像我期望的那样有效。我需要在$foundfiles中查找$results中不存在的值。钥匙永远不会匹配。。。我只对比较捕获#.jpg感兴趣 $foundfiles example : Array ( [0] => capture1000.jpg [1] => capture10045.jpg [2] => capture10050.jpg ... and so on $results example : Array ( [0]

这并不像我期望的那样有效。我需要在
$foundfiles
中查找
$results
中不存在的值。钥匙永远不会匹配。。。我只对比较
捕获#.jpg
感兴趣

$foundfiles example :

Array
(
    [0] => capture1000.jpg
    [1] => capture10045.jpg
    [2] => capture10050.jpg
    ... and so on

$results example :

Array
(
    [0] => capture27254.jpg
    [1] => capture27352.jpg
    [2] => capture27450.jpg
    ... and so on

$image_set = array_diff($foundfiles, $results);

在本例中,
$image\u set
应包含
$foundfiles
中的所有值,因为它们都不在
$results

中,请进一步解释这不起作用的含义!现在向我们展示你的产出和预期产出你期望什么?显示一个示例“这不起作用意味着”结果集,$image\u在本例中,不显示$results中不存在的$foundfiles中的结果。我在这里使用的是大型数组集,所以我不会将它们粘贴到中。@user756659对我来说很好!请向我们展示您当前对问题中的这些数组的输出。我一定是内存问题或其他问题-每个数组中都有2000多个结果。