There are two arrays.
files array holds file names.
contents array holds html texts.
I want to check filter files which are not included in contents.
$files = ["1.jpg", "2.jpg", "3.jpg", "4.jpg", "5.jpg"];
$contents = ["<p>random text</p>", "<p>another random text</p>", "<img src='1.jpg'>"];
I tried like below but did not work well.
$filter = [];
foreach ($contents as $key => $content) {
foreach($files as $key => $file) {
if(strpos($content, $file) == false) {
$filter[$key] = $file;
}
}
}
Thank you very much.