PHP is a simple method to determine whether an image is in the article. _ PHP Tutorial

Source: Internet
Author: User
PHP is a simple method for judging whether there are images in the article ,. PHP is a simple method to determine whether there are images in the article. The PHP program in this article is used to determine whether there are images in the article, the main implementation idea is to use preg_match to check whether there is PHP in the content to determine whether there is an image in the article,

The PHP program in this article is used to determine whether there are images in the article. its main implementation idea is to use preg_match to check whether there is a matching in the content. The following is the main implementation code:

$ Url = "http: // XXXXX/article/012.html"; $ content = file_get_contents ($ url); // read the source code of the article page if (preg_match ("//", $ content) {// perform regular matching to determine if an image echo "detects the image";} else {echo "no image ";}




Finally, the PHP program in this article is used to determine whether the article contains images. its main implementation idea is to use preg_match to check whether the content contains images...

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.