PHP Capture Code Help
I want to collect the list of this website product http://www.taomanzu.com/category-16-4-1-10000-1.html, function is, can also collect the product ID, and the name of the product, and write to the cache, such as HTTP/ An item ID in the www.taomanzu.com/category-16-4-1-10000-1.html list is: 9914540199, the title is: Cotton-trimmed nine-point trousers \ Tooling Nine-point trousers \ Casual nine-point pants 2-color
What I need is a product ID at the same time, and a product title, to synthesize a link such as
< a href=http://www.xxxx.com/tshow-9914540199.html "> cotton-trimmed nine-point trousers \ Tooling nine-point pants \ Casual Nine-point trousers 2 colors
The following code can only collect the product ID or title, how to modify it can be collected at the same time and merged into a link!
PHP Code
/is ', $file, $list) {foreach ($list [1] as $i = $k 1) if ($i <30) {//{$result = $resul T. ". $k 1."; }} $result _utf=iconv ("GB2312", "GB2312", $result); File_put_contents ($dir. " /cache_nvzhuang_new.html ", $result _utf);} Else{}?>
------Solution--------------------
Change your regular expression to
([^<]*?) <
And then modify the foreach to do it.