<?php
header("Content-Type: text/html; charset=utf-8");
$str = 'http://music.baidu.com/search?key=%E5%A5%BD%E7%94%B7%E4%BA%BA';
$str=file_get_contents($str);
//print_r($str);
preg_match_all('/<div class="song-item clearfix">.*<span class="index-num index-hook".*>(.+)<\/span>.*class="song-title".*<a href=".*>.*<em><em>(.+)<\/em>.*class="singer".*class="author_list" title="(.+)".*class="album-title".*<a.*>(.+)<\/a>.*class="high-rate-icon" title="(.+)"/isU',$str,$all);
print_r($all);
?>
PHP 正则匹配百度音乐列表
最新推荐文章于 2021-10-20 16:44:33 发布
