PHP Capture Code

Source: Internet
Author: User
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.

  • Contact Us

    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.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.