• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP getfile函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getfile函数的典型用法代码示例。如果您正苦于以下问题:PHP getfile函数的具体用法?PHP getfile怎么用?PHP getfile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getfile函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: GetVid

function GetVid($url)
{
    if (empty($url)) {
        return false;
    }
    $geturl = getfile($url, 'http://video.sina.com.cn', null);
    //手机版
    preg_match('#ipad\\_vid\\:\'(.*?)\'#is', $geturl, $key_str);
    //电脑版
    if (empty($key_str[1])) {
        preg_match('#vid\\:\'(.*?)\\|#is', $geturl, $key_str);
    }
    if (empty($key_str[1])) {
        preg_match('#vid\\:\'(.*?)\'#is', $geturl, $key_str);
    }
    //新浪新闻
    if (empty($key_str[1])) {
        preg_match('#videoId\\:\'(.*?)\'#is', $geturl, $key_str);
    }
    //新浪娱乐
    //	if(empty($key_str[1]))preg_match('#CurrentPlayingVideo[\s]\=[\s](.*?)\'#is', $geturl, $key_str);
    if (!empty($key_str[1])) {
        $key = $key_str[1];
    }
    if (empty($key)) {
        return false;
    }
    return $key;
}
开发者ID:rptec,项目名称:rpvideo,代码行数:29,代码来源:ID_SINA.php


示例2: GetVid

function GetVid($url)
{
    if (empty($url)) {
        return false;
    }
    $geturl = getfile($url, 'http://www.fun.tv', null);
    //网址形式
    preg_match('#\\"galleryid\\"\\:(.*?)\\,#is', $geturl, $key_str);
    //网址形式
    preg_match('#vplay\\.videoid[\\s]\\=[\\s](.*?)\\;#is', $geturl, $videoid);
    //  //电脑版
    //  if(empty($key_str[1]))preg_match('#vid\:\'(.*?)\|#is', $geturl, $key_str);
    //  if(empty($key_str[1]))preg_match('#vid\:\'(.*?)\'#is', $geturl, $key_str);
    //	//新浪新闻
    //	if(empty($key_str[1]))preg_match('#videoId\:\'(.*?)\'#is', $geturl, $key_str);
    //	//新浪娱乐
    ////	if(empty($key_str[1]))preg_match('#CurrentPlayingVideo[\s]\=[\s](.*?)\'#is', $geturl, $key_str);
    if (!empty($key_str[1])) {
        $key = $key_str[1];
    }
    if (!empty($videoid[1])) {
        $key .= '_' . $videoid[1];
    }
    if (empty($key)) {
        return false;
    }
    return $key;
}
开发者ID:rptec,项目名称:rpvideo,代码行数:28,代码来源:ID_FUN.php


示例3: GetVid

function GetVid($url)
{
    if (empty($url)) {
        return false;
    }
    preg_match("/\\/v\\/(.*?)\\//i", $url, $ketStr);
    if (empty($ketStr)) {
        for ($i = 0; $i < 3; $i++) {
            $c = getfile($url, $url, null);
            if ($c) {
                break;
            }
        }
        preg_match("/,vcode:[\\s]+\\'([X]{1}.*?)\\'/i", $c, $ketStr);
        if (empty($ketStr)) {
            preg_match("/,iid:[\\s]+([0-9]+)/i", $c, $ketStr);
        }
    }
    if (!empty($ketStr[1])) {
        $key = $ketStr[1];
    }
    if (empty($key)) {
        return false;
    }
    return $key;
}
开发者ID:rptec,项目名称:rpvideo,代码行数:26,代码来源:ID_TUDOU.php


示例4: GetVid

function GetVid($url)
{
    if (empty($url)) {
        return false;
    }
    $key = '';
    preg_match('/xiyou\\.cntv\\.cn\\/v-([0-9a-z-]+)\\.html/', $url, $keyStr);
    if (!empty($keyStr[1])) {
        $key = $keyStr[1];
    }
    if (!empty($key)) {
        return $key;
    }
    for ($i = 0; $i < 3; $i++) {
        $c = getfile($url, null, null);
        if (!empty($c)) {
            break;
        }
    }
    preg_match('/contentid\\"[\\s]+content=\\"([0-9a-z]+)\\">/i', $c, $keyStr);
    if (!empty($keyStr[1])) {
        preg_match('/videoCenterId\\",\\"([0-9a-z]+)\\"/i', $c, $keyStr);
    }
    if (!empty($keyStr[1])) {
        preg_match('/<!--repaste.video.code.begin-->([0-9a-z]+)<!--repaste.video.code.end-->/i', $c, $keyStr);
    }
    if (!empty($keyStr[1])) {
        $key = $keyStr[1];
    }
    if (empty($key)) {
        return false;
    }
    return $key;
}
开发者ID:rptec,项目名称:rpvideo,代码行数:34,代码来源:ID_CNTV.php


示例5: GetVideo_HTML5

function GetVideo_HTML5($key, $hdstyle)
{
    for ($i = 0; $i < 3; $i++) {
        $c = getfile('http://m.yinyuetai.com/video/' . $key, 'http://m.yinyuetai.com', null);
        preg_match('/videoUrl[\\s]:[\\s]\\"(.*?)\\",/', $c, $mp4);
        if (empty($mp4[1])) {
            preg_match('/window\\.location\\.herf[\\s]=[\\s]\\"(.*?)\\";/', $c, $mp4);
        }
        if (empty($mp4[1])) {
            preg_match('/video[\\s]preload[\\s]controls[\\s]x-webkit-airplay=\\"allow\\" src=\\"(.*?)\\"/', $c, $mp4);
        }
        if (empty($mp4[1])) {
            preg_match('/a class=\\"video-cover\\"[^>]*href=\\"(.*?)\\">/', $c, $mp4);
        }
        if (empty($mp4[1])) {
            preg_match('/source src=\\"(.*?)\\"/', $c, $mp4);
        }
        if (!empty($mp4[1])) {
            break;
        }
    }
    if (!empty($mp4[1])) {
        $video['data'][0]['src'] = $mp4[1];
    }
    return $video;
}
开发者ID:rptec,项目名称:rpvideo,代码行数:26,代码来源:TV_YINYUETAI.php


示例6: GetVideo_FLASH

function GetVideo_FLASH($key, $hdstyle)
{
    $banben = date('Y-m-d');
    //插件名字
    $video['name'] = "☆解析插件-ku6系统☆-" . $banben;
    //高清格式信息
    $hdstr = array(1 => "normal", 2 => "clear", 3 => "super");
    $video['Nowhds'] = $hdstyle >= 0 && $hdstyle < 4 ? $hdstyle : 3;
    $video['mixhds'] = 3;
    for ($i = 0; $i < 3; $i++) {
        $info = getfile('http://v.ku6.com/fetchVideo4Player/' . $key . '.html', 'http://v.ku6.com', null);
        if (!empty($info)) {
            break;
        }
    }
    $json = json_decode($info);
    $data = $json;
    if (!empty($data->data->t)) {
        $video['subject'] = $data->data->t;
    }
    //
    //		$vtimems = $data->vtimems;
    //		$vtime = $data->vtime;
    //		$f = $data->f;
    //    $vtimems = explode(',',$vtimems);
    //    $vtime = explode(',',$vtime);
    //    $f  = explode(',',$f);
    //    foreach ($vtime as $value1){
    //        $video['data'][$i]['bytes'] = $vtimems;
    //        $video['data'][$i]['duration'] = $vtime;
    //        $video['data'][$i]['src'] = $f;
    //   	$i++;
    //    }
    //            if(!empty($vtimems))$video['data'][$i]['bytes'] = $vtimems;
    //        if(!empty($vtime))$video['data'][$i]['duration'] = $vtime;
    //        if(!empty($f))$video['data'][$i]['src'] = $f;
    //    $i++;
    //   if(!empty($vtime))$video['data'][$i]['duration'] = $vtime;
    //    if(!empty($f))$video['data'][$i]['src'] = $f;
    //  $data->data->vtime = explode(',',$data->data->vtime);
    //   $data->data->vtimems = explode(',',$data->data->vtimems);
    $data->data->f = explode(',', $data->data->f);
    $i = 0;
    foreach ($data as $value) {
        for ($i = 0; $i < count($value->f); $i++) {
            //    if(!empty($value->vtimems[$i]))$video['data'][$i]['bytes'] = $value->vtimems[$i];
            //    if(!empty($value->vtime[$i]))$video['data'][$i]['duration'] = $value->vtime[$i];
            if (!empty($value->f[$i])) {
                $video['data'][$i]['src'] = $value->f[$i];
            }
            //		$i++;
        }
    }
    if (empty($video['data'][0]['src'])) {
        return false;
    }
    return $video;
}
开发者ID:rptec,项目名称:rpvideo,代码行数:58,代码来源:TV_KU6.php


示例7: get_url_content

function get_url_content($url)
{
    $data = getFileContents($url);
    if ($data["state"] == "ok") {
        return $data["file"];
    } else {
        return getfile($url);
    }
}
开发者ID:tanny2015,项目名称:DataStructure,代码行数:9,代码来源:spiderfuncs.php


示例8: Get_FLVCD

function Get_FLVCD($url, $hdstyle)
{
    // HD Style Information
    $hdstr = array(0 => "normal", 1 => "high", 2 => "super");
    // --END-- HD Style Information
    $video['Nowhds'] = $hds = $hdstyle >= 0 && $hdstyle < 3 ? $hdstyle : 2;
    $video['mixhds'] = 3;
    for ($i = 0; $i < 3; $i++) {
        $data = getfile('http://www.flvcd.com/parse.php?kw=' . $url . '&format=' . $hdstr[$hds], 'http://www.flvcd.com/', null);
        if (!empty($data)) {
            break;
        }
    }
    if (!empty($data)) {
        $data = kms_iconv($data, 'GBK', 'UTF-8');
        preg_match("/document.title[\\s]+=[\\s]+\"(.*?)\"/i", $data, $datarow);
        if (empty($datarow[1])) {
            preg_match("/hidden\"[\\s]+name=\"name\"[\\s]+value=\"(.*?)\"/i", $data, $datarow);
        }
        if (empty($datarow[1])) {
            preg_match("/hidden\"[\\s]+name=\"filename\"[\\s]+value=\"(.*?)\"/i", $data, $datarow);
        }
        if (!empty($datarow[1])) {
            $video['subject'] = $datarow[1];
        }
        preg_match("/<input[\\s]+type=\"hidden\"[\\s]+name=\"inf\"[\\s]+value=\"(.*?)\"\\/>/i", $data, $str);
        if (empty($str[1])) {
            preg_match_all("/<BR><a[\\s]+href=\"(.*?)\"/i", $data, $str2);
        }
        if (empty($str2[1]) && empty($str[1])) {
            preg_match_all("/<a[\\s]+href=\"(.*?)\"[\\s]+target=\"_blank\"[\\s]+class=\"link/i", $data, $str2);
        }
        if (!empty($str)) {
            $part = array_filter(explode("|", $str[1]), "strlen");
        }
        if (!empty($str2)) {
            $part = array_filter($str2[1], "strlen");
        }
        if (empty($part)) {
            return false;
        }
        $i = 0;
        foreach ($part as $value) {
            $video['data'][$i]['src'] = $value;
            $i++;
        }
    }
    if (empty($video['data'][0]['src'])) {
        return false;
    }
    return $video;
}
开发者ID:guiduan,项目名称:rpv,代码行数:52,代码来源:GET_FLVCD.php


示例9: GetVideo_HTML5

function GetVideo_HTML5($key, $hdstyle, $userkey)
{
    if (hostmd5key() != $userkey) {
        $video['data'][0]['src'] = '对不起您的授权码错误,暂不能提供解析!';
        return $video;
        exit;
    } else {
        for ($i = 0; $i < 3; $i++) {
            $token = getfile('http://api.lyhaoyu.cn/Index.php/Index/index/License/token/' . $userkey, '', null);
            if (!empty($token)) {
                break;
            }
        }
        $token = json_decode($token);
        $keytime = $token[0]->keytime;
        if ($keytime <= date('Y-m-d')) {
            $video['data'][0]['src'] = '对不起您的许可码已过期,暂不能提供解析!';
            return $video;
            exit;
        }
        $whtime = $token[0]->whtime;
        $banben = "2015-04-24";
        if ($whtime <= $banben) {
            $video['data'][0]['src'] = '对不起您的维护期已过期,暂不能使用此版本!';
            return $video;
            exit;
        }
    }
    //	插件名字
    $video['name'] = "☆宁哥解析插件-bilibili系统☆";
    //高清格式信息
    $hdstr = array(0 => "720P", 1 => "350", 2 => "1080P", 3 => "1000");
    $video['Nowhds'] = $hds = $hdstyle >= 0 && $hdstyle < 4 ? $hdstyle : 2;
    $video['mixhds'] = 4;
    //加载信息
    $info = getfile('http://www.bilibili.com/m/html5?cid=' . $key, 'http://www.bilibili.com', null);
    preg_match('#src\\"\\:\\"(.*?)\\"\\}#i', $info, $vurl);
    if (empty($vurl[1])) {
        $info = getfile('http://www.bilibili.com/m/html5?aid=' . $key, 'http://www.bilibili.com', null);
    }
    preg_match('#src\\"\\:\\"(.*?)\\"\\}#i', $info, $vurl);
    $i = 0;
    if (!empty($vurl[1])) {
        $video['data'][$i]['src'] = str_replace('&amp;', '&', $vurl[1]);
    }
    if (empty($video['data'][0]['src'])) {
        return false;
    }
    return $video;
}
开发者ID:guiduan,项目名称:rpv,代码行数:50,代码来源:TV_BILIBILI.php


示例10: getfile

function getfile($path, $dbxClient)
{
    $fileOrfolder = $dbxClient->getMetadataWithChildren($path);
    if (sizeof($fileOrfolder["contents"] > 0)) {
        $f = 0;
        foreach ($fileOrfolder["contents"] as $content) {
            if ($content["is_dir"] != 1) {
                echo '<li>' . $content["path"] . '</li>';
            } else {
                $f = 1;
                getfile($content["path"], $dbxClient);
            }
        }
        if ($f == 0) {
            return;
        }
    }
}
开发者ID:aniruddha-chakraborty,项目名称:UploaDrop,代码行数:18,代码来源:index.php


示例11: GetVid

function GetVid($url)
{
    if (empty($url)) {
        return false;
    }
    preg_match("/^http\\:\\/\\/static\\.video\\.qq\\.com\\/TPout\\.swf\\?[0-9a-z&=_-]*vid=(\\w+)/i", $url, $ketStr);
    if (empty($ketStr)) {
        $geturl = getfile($url, 'http://v.qq.com', null);
        preg_match('#vid:"([0-9a-z]+)"#is', $geturl, $key_str);
    }
    if (!empty($key_str[1])) {
        $key = $key_str[1];
    }
    if (empty($key)) {
        return false;
    }
    return $key;
}
开发者ID:rptec,项目名称:rpvideo,代码行数:18,代码来源:ID_QQ.php


示例12: GetVideo_HTML5

function GetVideo_HTML5($key, $hdstyle)
{
    //	插件名字
    //http://vv.video.qq.com/geturl?vid=
    $content = getfile('http://vv.video.qq.com/geturl?vid=' . $key . '&otype=json', 'http://v.qq.com');
    preg_match('~QZOutputJson\\s*=\\s*(.*);~iUs', $content, $info);
    $json = json_decode($info[1]);
    $vd = $json->vd->vi[0];
    $url = $vd->url;
    $i = 0;
    if (!empty($url)) {
        $video['data'][$i]['src'] = $url;
    }
    if (empty($video['data'][0]['src'])) {
        return false;
    }
    return $video;
}
开发者ID:guiduan,项目名称:rpv,代码行数:18,代码来源:TV_QQ.php


示例13: GetVideo_HTML5

function GetVideo_HTML5($key, $hdstyle)
{
    $info = getfile('http://www.wasu.cn/Api/getPlayInfoById/id/' . $key . '/datatype/xml', 'http://www.wasu.cn', null);
    preg_match('#<video>(.*)</video>#i', $info, $vurl);
    $getkey = getfile('http://www.wasu.cn/Play/show/id/' . $key, 'http://www.wasu.cn', null);
    preg_match("#playKey[\\s]=[\\s]'(.*)',_playTitle#i", $getkey, $urlkey);
    $url = 'http://www.wasu.cn/Api/getVideoUrl/id/' . $key . '/url/' . $vurl[1] . '/key/' . $urlkey[1] . '/';
    $content = getfile($url, 'http://s.wasu.cn/', null);
    preg_match('#<video><!\\[CDATA\\[(.*)\\]\\]></video>#i', $content, $vurl);
    if (empty($vurl[1])) {
        return;
    }
    $i = 0;
    //视频标题
    $video['data'][$i]['src'] = $vurl[1] . '?version=MIPlayer_V1.3.2';
    if (empty($video['data'][0]['src'])) {
        return false;
    }
    return $video;
}
开发者ID:guiduan,项目名称:rpv,代码行数:20,代码来源:TV_WASU-DM.php


示例14: get

function get($m)
{
    /*{{{*/
    require_once 'api/function.getfile.php';
    $param0 = $m->getParam(0);
    $file = $param0->scalarval();
    if ($m->getNumParams() == 2) {
        $param1 = $m->getParam(1);
        $format = $param1->scalarval();
    }
    if ($format != "raw" && $format != "gzip") {
        $format = "raw";
    }
    $data = getfile($file, $format);
    if (!$data || empty($data)) {
        $error = "Could not read file: {$file}, in format: {$format}";
        return new XML_RPC_Response(0, $GLOBALS['XML_RPC_erruser'], $error);
    }
    return new XML_RPC_Response(new XML_RPC_Value($data, $GLOBALS['XML_RPC_Base64']));
}
开发者ID:SandyS1,项目名称:presentations,代码行数:20,代码来源:xmlrpc.php


示例15: GetVideo_HTML5

function GetVideo_HTML5($key, $hdstyle)
{
    for ($i = 0; $i < 3; $i++) {
        $info = getfile('http://vdn.apps.cntv.cn/api/getHttpVideoInfo.do?pid=' . $key, 'http://www.cntv.cn', null);
        if (!empty($info)) {
            break;
        }
    }
    $json = json_decode($info);
    $data = $json;
    $video['data'][0]['bpsrc'] = $data->hls_url;
    if (empty($video['data'][0]['src'])) {
        $video['data'][0]['src'] = $data->hls_url;
        $video['data'][0]['bpsrc'] = null;
    }
    if (empty($video['data'][0]['src'])) {
        return false;
    }
    return $video;
}
开发者ID:rptec,项目名称:rpvideo,代码行数:20,代码来源:TV_CNTV.php


示例16: GetVid

function GetVid($url)
{
    if (empty($url)) {
        return false;
    }
    /*	
    			preg_match("/^http\:\/\/static\.video\.qq\.com\/TPout\.swf\?[0-9a-z&=_-]*vid=(\w+)/i", $url, $ketStr);
    		
    	if(empty($ketStr)){*/
    $geturl = getfile($url, 'http://www.iqiyi.com', null);
    preg_match('#videoid="(.*?)"#is', $geturl, $key_str);
    //	}
    if (!empty($key_str[1])) {
        $key = $key_str[1];
    }
    if (empty($key)) {
        return false;
    }
    return $key;
}
开发者ID:rptec,项目名称:rpvideo,代码行数:20,代码来源:ID_IQIYI_.php


示例17: GetVideo_HTML5

function GetVideo_HTML5($key, $hdstyle)
{
    for ($i = 0; $i < 3; $i++) {
        $info = getfile('http://m.api.hunantv.com/video/relatedVideos/?_1&videoId=' . $key, 'http://m.hunantv.com', null);
        if (!empty($info)) {
            break;
        }
    }
    $json = json_decode($info);
    $data = $json->data;
    $url = $data[0]->downloadUrl;
    $url = getfile($url, 'http://m.hunantv.com', null);
    $data = json_decode($url);
    $src = $data->info;
    if (!empty($src)) {
        $video['data'][0]['src'] = $src;
    }
    if (empty($video['data'][0]['src'])) {
        return false;
    }
    return $video;
}
开发者ID:guiduan,项目名称:rpv,代码行数:22,代码来源:TV_HUNANTV.php


示例18: GetVideo_HTML5

function GetVideo_HTML5($key, $hdstyle)
{
    //加载信息
    $url = geturl($key);
    for ($i = 0; $i < 3; $i++) {
        $info = getfile($url, 'http://video.sina.com.cn', null);
        if (!empty($info)) {
            break;
        }
    }
    preg_match_all('#\\<url\\>\\<\\!\\[CDATA\\[(.*?)\\]\\]\\>\\<\\/url\\>#i', $info, $vurl);
    $i = 0;
    foreach ($vurl[1] as $value) {
        if (!empty($value)) {
            $video['data'][$i]['src'] = $value;
        }
        $i++;
    }
    if (empty($video['data'][0]['src'])) {
        return false;
    }
    return $video;
}
开发者ID:rptec,项目名称:rpvideo,代码行数:23,代码来源:TV_SINA.php


示例19: GetVideo_FLASH

function GetVideo_FLASH($key, $hdstyle)
{
    $banben = date('Y-m-d');
    //插件名字
    $video['name'] = "☆解析插件-56系统☆-" . $banben;
    //高清格式信息
    $hdstr = array(0 => "normal", 1 => "clear", 2 => "super");
    $video['Nowhds'] = $hdstyle >= 0 && $hdstyle < 3 ? $hdstyle : 2;
    $video['mixhds'] = 2;
    for ($i = 0; $i < 3; $i++) {
        $info = getfile('http://vxml.56.com/json/' . $key . '/?src=out', 'http://vxml.56.com', null);
        if (!empty($info)) {
            break;
        }
    }
    $json = json_decode($info);
    $data = $json->info;
    if (!empty($data->Subject)) {
        $video['subject'] = $data->Subject;
    }
    $i = 0;
    foreach ($data->rfiles as $value) {
        if (!empty($value->filesize)) {
            $video['data'][$i]['bytes'] = $value->filesize;
        }
        if (!empty($value->totaltime)) {
            $video['data'][$i]['duration'] = $value->totaltime;
        }
        if (!empty($value->url)) {
            $video['data'][$i]['src'] = $value->url;
        }
    }
    if (empty($video['data'][0]['src'])) {
        return false;
    }
    return $video;
}
开发者ID:rptec,项目名称:rpvideo,代码行数:37,代码来源:TV_56.php


示例20: GetVid

function GetVid($url)
{
    if (empty($url)) {
        return false;
    }
    for ($i = 0; $i < 3; $i++) {
        $c = getfile($url, null, null);
        if (!empty($c)) {
            break;
        }
    }
    preg_match("/var[\\s]+vid=\"([0-9]+)\"/i", $c, $key_str);
    if (empty($key_str[1])) {
        preg_match("/var[\\s]+vid[\\s]+=[\\s]+\\'([0-9]+)\\'/i", $c, $key_str);
    }
    if (empty($key_str[1])) {
        preg_match("/,vid:[\\s]+\\'([0-9]+)\\'/i", $c, $key_str);
    }
    if (empty($key_str[1])) {
        return false;
    }
    $key = $key_str[1];
    return $key;
}
开发者ID:rptec,项目名称:rpvideo,代码行数:24,代码来源:ID_SOHU.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getfiles函数代码示例发布时间:2022-05-15
下一篇:
PHP getext函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap