本文整理汇总了PHP中Http::get_string_between方法的典型用法代码示例。如果您正苦于以下问题:PHP Http::get_string_between方法的具体用法?PHP Http::get_string_between怎么用?PHP Http::get_string_between使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Http
的用法示例。
在下文中一共展示了Http::get_string_between方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Http
$http = new Http();
$tpl = new Template();
if ($_GET['type'] == 'play') {
$id = $_GET['id'];
$http->clear();
$http->setTarget('http://mp3.zing.vn/bai-hat/' . $id . '.html');
$http->setReferrer("http://mp3.zing.vn");
$http->execute();
$html = $http->result;
if (strpos($html, '404.png') > 0) {
die;
}
// $fp = fopen("te.txt","w");
// fwrite($fp,$html);
// fclose($fp);
$image = $http->get_string_between($html, 1, 0, '<meta property="og:image" content="', '"');
$xml = $http->get_string_between($html, 1, 0, 'xmlURL=', '&textad');
if ($xml == '' || $xml == null || $xml == ' ') {
$title = 'Thông Báo';
$keyword = '.';
} else {
///lay link .mp3
$http->clear();
$http->setTarget($xml);
$http->setReferrer("http://mp3.zing.vn");
$http->execute();
$html = $http->result;
$url = $http->get_string_between($html, 1, 0, '<source><![CDATA[', ']]></source>');
$name = $http->get_string_between($html, 1, 0, '<title><![CDATA[ ', ']]></title>');
$singer = $http->get_string_between($html, 1, 0, '<performer><![CDATA[', ']]></performer>');
///
示例2: Http
<?php
include "http.class.php";
$http = new Http();
if ($_GET['id']) {
$id = $_GET['id'];
$http->clear();
$http->setTarget('http://mp3.zing.vn/bai-hat/' . $id . '.html');
$http->setReferrer("http://mp3.zing.vn");
$http->execute();
$html = $http->result;
$xml = $http->get_string_between($html, 1, 0, 'xmlURL=', '&textad');
///lay link .mp3
$http->clear();
$http->setTarget($xml);
$http->setReferrer("http://mp3.zing.vn");
$http->execute();
$html = $http->result;
$url = $http->get_string_between($html, 1, 0, '<source><![CDATA[', ']]></source>');
$name = $http->get_string_between($html, 1, 0, '<title><![CDATA[ ', ']]></title>');
$singer = $http->get_string_between($html, 1, 0, '<performer><![CDATA[', ']]></performer>');
$type = trim(substr($url, -3));
$filename = $name . '__' . $singer;
$filename = str_replace(' ', '-', $filename);
$filename = $filename . '.' . $type;
$filename = $http->mark_to_non($filename);
switch ($type) {
case "mp3":
$ctype = "audio/mpeg";
break;
case "wav":
示例3: explode
}
$singer_ = explode('<performer><![CDATA[',$html);
$singer1 = array_shift($singer_);
$singer = array();
foreach ($singer_ as $key => $value) {
$singert = explode(']]',$value);
$singer[] = $singert[0];
}
*/
//mp3.zing.vn
$http->setTarget('http://mp3.zing.vn/album/' . $id . '.html');
$http->setReferrer("http://mp3.zing.vn");
$http->execute();
$html = $http->result;
$title = $http->get_string_between($html, 1, 0, '<title>', '</title>');
$xml = $http->get_string_between($html, 1, 0, 'xmlURL=', '&textad');
$http->clear();
$http->setTarget($xml);
$http->setReferrer("http://mp3.zing.vn");
$http->execute();
$html = $http->result;
$url_ = explode('<source><![CDATA[', $html);
$url1 = array_shift($url_);
$url = array();
foreach ($url_ as $key => $value) {
$urlt = explode(']]', $value);
$url[] = $urlt[0];
}
$mp3 = array();
foreach ($url as $key => $value) {