function
getdata(
$i,
$url) {
$data =
array();
// 把整个文件读入到字符串中
$str =
file_get_contents(
$url);
$str =
substr(
$str,
strpos(
$str,
'album-head-info clearfix'));
// print_r($str);
$str =
substr(
$str,
0,
strpos(
$str,
'class="album-auto"'));
$preg=
'/
?id="j-album-title".*
?>(.*
?)<
\/
a>/is';
preg_match_all(
$preg,
$str,
$match);
//echo $str;exit;
$title =
$match[
1][
0];
$data[
'title'] =
$title;
$preg=
'/
?class="info-intro-title-s".*
?>(.*
?)<
\/
span>/is';
preg_match_all(
$preg,
$str,
$match);
$other_title =
$match[
1][
0];
$data[
'other_title'] =
$other_title;
//地区
$preg=
'/
?class="episodeIntro-area".*
?>.*
?(.*
?)<
\/
em>.*
?
?>(.*
?)<
\/
a>.*
?<
\/
p>/is';
preg_match_all(
$preg,
$str,
$match);
$data[
'area'] =
trim(
$match[
2][
0]);
//语言
$preg=
'/
?class="episodeIntro-lang".*
?>.*
?(.*
?)<
\/
em>.*
?
?>(.*
?)<
\/
span>.*
?<
\/
p>/is';
preg_match_all(
$preg,
$str,
$match);
$data[
'lang'] =
trim(
$match[
2][
0]);
//类型-悬疑/历史/剧情
$preg=
'/