A product ID in the items list is: 99145401 PHP collection code for help
I want to collect the list of products of this website in two colors
What I need is to collect the product ID and product title at the same time, and combine a link such
<A href = http://www.xxxx.com/tshow-9914540199.html "> cotton wool slice pants \ tooling 9 pants \ casual 9 pants 2 colors
The following code can only collect the product ID or title. how can I modify it to collect and combine it into a link!
PHP code
/Is ', $ file, $ list) {foreach ($ list [1] as $ I => $ k1) if ($ I <30) {// {$ result = $ result. ''. $ k1. '';}$ result_utf = iconv (" GB2312 "," GB2312 ", $ result); file_put_contents ($ dir. "/Cache_NvZhuang_new.html", $ result_utf);} else {}?>
------ Solution --------------------
Replace your regular expression
([^ <] *?) <
Then modify foreach.