PHP Regular
Reply to discussion (solution)
Match what? All or part of it? What are the rules? Describe it in detail.
W
Match what? All or part of it? What are the rules? Describe it in detail. I use Curl to crawl a Web page to match the name value in this paragraph.
Do you have any special rules, you can put more code AH.
Match the label of Id= "Onlickimg"
Do you have any special rules, you can put more code AH.
This is the code that crawls the content of the Web page and then gets the product picture of this website
$ch = Curl_init (); curl_setopt ($ch, Curlopt_url, "http://item.vt.vancl.com/0194233.html"); curl_setopt ($ch, Curlopt_ timeout,30); curl_setopt ($ch, curlopt_useragent, _useragent_); curl_setopt ($ch, curlopt_referer,_referer_); curl_ Setopt ($ch, Curlopt_returntransfer, 1); $content = Curl_exec ($ch); Curl_close ($ch);p Reg_match ("regular", $content, $img)
Then I want to get a picture of the product in the webpage, write a half-day always match the picture of the product
Match the label of Id= "Onlickimg"
I wrote the match id= "Onlickimg", and then it always matches the value of the name.
preg_match_all ('/
preg_match_all ('/