How does PHP determine the file names of multiple images and return the missing images?

Source: Internet
Author: User
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);?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.