How does PHP determine the file names of multiple images and return the missing images? For example, if you have stored a single field ('1.jpg, '2.jpg, '3.jpg ');
How to determine whether the image fields stored in the database are the same and return the missing image names of the database?
How to implement data inventory in php code is to store multiple images in one field...
Reply to discussion (solution)
Read the field content and parse the name of the image.
Configure the path and check with the file_exists function in the loop.
Read the database content first. Break it into an array and traverse it to determine whether the file exists.
$v){ if(!file_exists($v)){ $notexists[] = $v; }}print_r($notexists);?>
Read the database content first. Break it into an array and traverse it to determine whether the file exists.
$v){ if(!file_exists($v)){ $notexists[] = $v; }}print_r($notexists);?>
My file is a specified folder. how can I check whether a file exists in this folder? file_exists
$ V) {if (! File_exists ($ folder. $ v) {$ notexists [] = $ v ;}} print_r ($ notexists);?>