mercredi 3 juin 2020

Get which file doesn't exist with file_exists but using an array

Well,

I have a script, that checks if one of the files in the array exists or not.

But now I don't know how to get the file, from the array that doesn't exist. Here's an example:

<?php
$files = [
   "user/important.ini",
   "user/really_needed.php"
];

if(file_exists($files) == false) {
   $data = "1";
   $meta = array(
       "file" => ????,
       "error" => "Missing file"
    );

?>

So I'd like to "replace" the "????" with the file that doesn't exists, since I don't know how to get this file, it's those question marks.

Is there possible code I could use, to get the file that doesn't exist?




Aucun commentaire:

Enregistrer un commentaire