php获取淘宝分类id示例

复制代码 代码如下:
$url = “”;
  $html = file_get_contents($url);
  echo ‘

‘;
  $pattern=’/(.*?)/’;
  preg_match_all($pattern, $html, $array, PREG_SET_ORDER);
  foreach($array as $item) {
澳门新葡亰3522平台游戏,   echo $item[1] . “=>” . mb_convert_encoding($item[2],
‘UTF-8’, ‘GB2312’);
   echo “
“;
  }