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...