In recent work, the src attribute value (image address) of the img label in the content is often used for reading. Because the attribute value has no regularity, it is a good way to use regular expressions, next we will use php and js for instance
Php is used to process all img tags in a piece of html code. there is a piece of html code that contains many tags and a lot of img tags. now, you need to extract the src Image addresses of all img tags in php language, and process them through a
This article introduces to you about PHP according to different conditions to replace a piece of HTML code in the different IMG tags, there is a certain reference value, the need for friends can refer to, I hope to help you.
First, the demand
The
Often and pictures to deal with, had to use some of the images to extract SCR, alt, title, and so on attributes, summed up here to everyone some commonly used, feel good, more general!PHP Regular expression matches any attribute in img PHP
Because there is a project news publishing system, the path of the source image is stored in the database content field (of course there are other text content. When illustrations are in the content, the image path is saved ), however, if you want
Because there is a project press release system, the database content field is stored in the original image of the path (and of course, there are other text content, the content of the illustrations, save the picture path), but the front desk want
Because there is a project news publishing system, the path of the source image is stored in the database content field (of course there are other text content. When illustrations are in the content, the image path is saved ), however, if you want
PHP collects static pages and saves css, img, and js pages, and static page css.
This example describes how PHP collects static pages and saves css, img, and js pages. Share it with you for your reference. The specific analysis is as follows:
This
I often deal with images and have to use some attributes that extract scr, alt, title, and so on from images. Here I will summarize some of the frequently used attributes. It feels good and common!PHP Regular Expression matches any attribute in img
This article illustrates the method of PHP to collect static page and save the page Css,img,js. Share to everyone for your reference. The specific analysis is as follows:
This is a Web page of HTML code and Css,js,font and IMG Resources of the
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.