当前位置: 首页>>代码示例>>PHP>>正文


PHP Http::get_string_between方法代码示例

本文整理汇总了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=', '&amp;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>');
        ///
开发者ID:noikiy,项目名称:musicwebsite,代码行数:31,代码来源:get.php

示例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=', '&amp;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":
开发者ID:noikiy,项目名称:musicwebsite,代码行数:31,代码来源:download.php

示例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=', '&amp;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) {
开发者ID:noikiy,项目名称:musicwebsite,代码行数:31,代码来源:get_album.php


注:本文中的Http::get_string_between方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。