PHP collection program problems
These two sections are collected by me. when collecting two product pages, I want the product image address.
Http://ec2.images-amazon.com/images/ I /418Qdk6bctL._SL500_AA280_.jpg
Http://ec2.images-amazon.com/images/ I /51bsLAswKVL._SL500_AA280_.jpg
There are a lot of code on the whole page. I just want this image.
Http://ec2.images-amazon.com/images/ I/
._SL500_AA280_.jpg
Each page of the above two sections is the same. how can I filter the image address I want?
Reply to discussion (solution)
Add id = "prodImage" to distinguish other images.
No
Just http://ec2.images-amazon.com/images/ I/
The address ._SL500_AA280_.jpg is enough, but the numbers in the middle are different. all such addresses on a page are the same image.
Http://ec2.images-amazon.com/images/ I /51bsLAswKVL._SL500_AA280_.jpg
This address is unique on a page, but 51bsLAswKVL in the middle will be different.
Preg_match_all ('# src = "(http: // ec2 \. images-amazon \. com/images/I/[a-z \ d] + \. _ SL500_AA280 _\. jpg) "# is ', $ s, $ m );
Print_r ($ m [1]);