在一组图像中搜索图像

我有一堆图片我想在图片中搜索特定图像我想检查该图像是否在矩阵中可用


<?php 

$ima="image1.PNG";


$md5image1 = md5(file_get_contents($ima));


$images=array( "image1.PNG","image2.PNG","image3.PNG","image4.PNG"  ); 

srand(time()); 

shuffle($images); 

    for ($i=0;$i<5;++$i)

    if ($ima == $images) {

       echo "yes";} 


    else {

       echo "no";

}

?>


撒科打诨
浏览 178回答 1
1回答

缥缈止盈

尝试这个<?php&nbsp;$ima="image1.PNG";$md5image1 = md5(file_get_contents($ima));$images=array( "image1.PNG","image2.PNG","image3.PNG","image4.PNG"&nbsp; );&nbsp;srand(time());&nbsp;shuffle($images);&nbsp;if (in_array("$ima", $images))&nbsp; &nbsp;{&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;echo "Search found";&nbsp; &nbsp;}&nbsp; &nbsp; else&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo "Search not found";&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }?>
打开App,查看更多内容
随时随地看视频慕课网APP