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


PHP str_between函数代码示例

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


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

示例1: get_local_time_zone

function get_local_time_zone()
{
    $link = "http://www.ip2location.com";
    $string = str_between(g_file($link), ">Time Zone</label></td>", "</tr>");
    $string = str_between($string, '<label for="chkTimeZone">', "</label>");
    return $string;
}
开发者ID:Lages2014,项目名称:scripts-mini,代码行数:7,代码来源:prahovahd.php

示例2: mylink

function mylink($string)
{
    $html = file_get_contents($string);
    $l = str_between($html, 'value=&quot;', '&');
    if ($l != "") {
        $file = get_headers($l);
        foreach ($file as $key => $value) {
            if (strstr($value, "Location")) {
                $url = ltrim($value, "Location: ");
                $link1 = str_between($url, "file=", "&");
            }
            // end if
        }
        // end foreach
        if ($link1 != "") {
            return $link1;
        }
    }
}
开发者ID:johnymarek,项目名称:eboda-hd-for-all-500,代码行数:19,代码来源:protv_link.php

示例3: pr_func_call

function pr_func_call($file, $line, $ofp = stdout)
{
    $alt_line = str_replace(" ", "", $line);
    $x = str_between("=", "(", $line);
    if (!isset($x)) {
        return;
    }
    $x = trim($x);
    $y = strtolower($x);
    $Y = str_split($y);
    $to_pr = true;
    for ($i = 0; $i < count($Y); $i++) {
        if (ctype_alnum($Y[$i]) === true || $Y[$i] == "_") {
            /* all is well */
        } else {
            $to_pr = false;
            break;
        }
    }
    if ($to_pr === true) {
        fprintf($ofp, "%s,%s\n", $file, $x);
    }
}
开发者ID:suxinde2009,项目名称:datacl,代码行数:23,代码来源:mk_header.php

示例4: get_movie

function get_movie($noob1, $s, $id1, $auth1, $hd1, $tv1, $id1)
{
    $i = $s;
    if ($tv1 == "1") {
        $hd1 = "0";
    }
    $l = $noob1 . "/fork.php?type=flv&auth=" . $auth1 . "&loc=" . $i . "&hd=" . $hd1 . "&tv=" . $tv1;
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $l);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    //curl_setopt($ch, CURLOPT_FOLLOWLOCATION  ,1);
    curl_setopt($ch, CURLOPT_HEADER, 1);
    curl_setopt($ch, CURLOPT_NOBODY, 1);
    curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/noobroom.txt");
    curl_setopt($ch, CURLOPT_REFERER, $noob1 . "/player.swf");
    curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Language: ro-ro,ro;q=0.8,en-us;q=0.6,en-gb;q=0.4,en;q=0.2", "Accept-Encoding: gzip, deflate"));
    curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20100101 Firefox/14.0.1');
    $html = curl_exec($ch);
    curl_close($ch);
    $link = trim(str_between($html, "Location:", "/index.php"));
    $movie_link = $link . "/index.php?file=" . $id1 . "&start=0&type=flv&hd=" . $hd1 . "&auth=" . $auth1 . "&tv=" . $tv1;
    return $movie_link;
}
开发者ID:Lages2014,项目名称:scripts-mini,代码行数:23,代码来源:noobroom_link.php

示例5: strpos

    $len = strpos($string, $end, $ini) - $ini;
    return substr($string, $ini, $len);
}
$videos = explode('<div class="video">', $html);
unset($videos[0]);
$videos = array_values($videos);
foreach ($videos as $video) {
    $t1 = explode('href="', $video);
    $t2 = explode('"', $t1[1]);
    $link = "http://www.redtube.com" . $t2[0];
    $link = $host . "/scripts/adult/php/redtube_link.php?file=" . $link;
    $t1 = explode("src='", $video);
    $t2 = explode("'", $t1[1]);
    $image = $t2[0];
    $title = str_between($video, 'title="', '"');
    $data = trim(str_between($video, '<span class="d">', "<"));
    $data = "Durata: " . $data;
    $name = preg_replace('/[^A-Za-z0-9_]/', '_', $title) . ".flv";
    echo '
    <item>
    <title>' . $title . '</title>
    <onClick>
    <script>
    showIdle();
    url="' . $link . '";
    movie=getUrl(url);
    cancelIdle();
    streamArray = null;
    streamArray = pushBackStringArray(streamArray, "");
    streamArray = pushBackStringArray(streamArray, "");
    streamArray = pushBackStringArray(streamArray, movie);
开发者ID:johnymarek,项目名称:eboda-hd-for-all-500,代码行数:31,代码来源:redtube.php

示例6: strpos

    $len = strpos($string, $end, $ini) - $ini;
    return substr($string, $ini, $len);
}
$cookie = "/tmp/futubox_c.txt";
//$cookie="D://futubox_c.txt";
$serv = "s01";
$link = urldecode($link);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $link);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
$html = curl_exec($ch);
curl_close($ch);
$sid = str_between($html, 'url_key:encodeURIComponent("', '"');
//$y=str_between($html,'setChannel("','"');
$h1 = explode("this.setChannel", $html);
preg_match_all("/z\\d{6}/", $h1[1], $m);
$ch = $m[0];
if ($ch[1]) {
    if ($server == "HD") {
        $y = $ch[0];
    } else {
        $y = $ch[1];
    }
} else {
    $y = $ch[0];
}
$y = $y . ".stream" . $sid;
$rtmp = "rtmp://" . $serv . ".webport.tv:1935/live";
开发者ID:Lages2014,项目名称:scripts-mini,代码行数:31,代码来源:tvsector_link.php

示例7: str_between

	<menu>main menu</menu>
<?php 
function str_between($string, $start, $end)
{
    $string = " " . $string;
    $ini = strpos($string, $start);
    if ($ini == 0) {
        return "";
    }
    $ini += strlen($start);
    $len = strpos($string, $end, $ini) - $ini;
    return substr($string, $ini, $len);
}
$html = file_get_contents("http://www.hardsextube.com/categories/");
$img = "image/movies.png";
$html = str_between($html, '<div class="catfloat"', '</table>');
$videos = explode('href="', $html);
unset($videos[0]);
$videos = array_values($videos);
foreach ($videos as $video) {
    $t3 = explode(">", $video);
    $t4 = explode("<", $t3[1]);
    $title = trim($t4[0]);
    if (strpos($video, "?search=") !== false && $title != "") {
        $link = str_replace(" ", "%20", $title);
        $link = $host . "/scripts/adult/php/hardsextube.php?query=1," . trim(strtolower($link));
        echo '
  	<item>
  		<title>' . $title . '</title>
  		<link>' . $link . '</link>
  	</item>';
开发者ID:johnymarek,项目名称:eboda-hd-for-all-500,代码行数:31,代码来源:hardsextube_main.php

示例8: str_between

#!/usr/local/bin/Resource/www/cgi-bin/php
<?php 
function str_between($string, $start, $end)
{
    $string = " " . $string;
    $ini = strpos($string, $start);
    if ($ini == 0) {
        return "";
    }
    $ini += strlen($start);
    $len = strpos($string, $end, $ini) - $ini;
    return substr($string, $ini, $len);
}
$link = $_GET["file"];
$html = file_get_contents($link);
$link = str_between($html, 'url":"', '"');
print $link;
开发者ID:johnymarek,项目名称:eboda-hd-for-all-500,代码行数:17,代码来源:sovok_link.php

示例9: explode

<link>' . $url . '</link>
<annotation>Předchozí strana</annotation>
<durata></durata>
<pub></pub>
<mediaDisplay name="threePartsView"/>
</item>';
}
$videos = explode('<entry>', $html);
unset($videos[0]);
$videos = array_values($videos);
foreach ($videos as $video) {
    $id = str_between($video, "<id>http://gdata.youtube.com/feeds/api/videos/", "</id>");
    $title = str_between($video, "<title type='text'>", "</title>");
    $descriere = str_between($video, "<content type='text'>", "</content>");
    $durata = sec2hms(str_between($video, "duration='", "'"));
    $data = str_between($video, "<updated>", "</updated>");
    $data = str_replace("T", " ", $data);
    $data = str_replace("Z", "", $data);
    $data = explode(" ", $data);
    $data = $data[0];
    $name = preg_replace('/[^A-Za-z0-9_]/', '_', $title) . ".mp4";
    $item['title'] = $title;
    $item['id'] = $id;
    $item['name'] = $name;
    $item['annotation'] = $descriere;
    $item['durata'] = $durata;
    $item['pub'] = $data;
    echo CreateItem($item);
}
$sThisFile = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'];
$url = $sThisFile . "?query=" . ($page + 25) . ",";
开发者ID:johnymarek,项目名称:manta,代码行数:31,代码来源:youtube_user.php

示例10: explode

$videos = explode('<div class="moviebox"', $html);
unset($videos[0]);
$videos = array_values($videos);
foreach ($videos as $video) {
    $t1 = explode('<a href="', $video);
    $t2 = explode('"', $t1[1]);
    $link = "http://www.eporner.com" . $t2[0];
    $link = $host . "/scripts/adult/php/eporner_link.php?file=" . $link;
    $t1 = explode('src="', $video);
    $t2 = explode('"', $t1[1]);
    $image = $t2[0];
    $t1 = explode('title="', $video);
    $t2 = explode('>', $t1[2]);
    $t3 = explode('<', $t2[1]);
    $title = $t3[0];
    $data = str_between($video, '<div class="mitime" >', "</div>");
    $data = preg_replace("/(<\\/?)(\\w+)([^>]*>)/e", "", $data);
    echo '
  <item>
  <title>' . $title . '</title>
  <link>' . $link . '</link>
  <image>' . $image . '</image>
  <annotation>' . $data . '</annotation>
  <media:thumbnail url="' . $image . '" />
  <mediaDisplay name="threePartsView"/>
  </item>
  ';
}
?>

<item>
开发者ID:Lages2014,项目名称:scripts-mini,代码行数:31,代码来源:eporner.php

示例11: explode

}
$videos = explode('<div class="vidbox">', $html);
unset($videos[0]);
$videos = array_values($videos);
foreach ($videos as $video) {
    $t1 = explode('a href="', $video);
    $t2 = explode('"', $t1[1]);
    $link = "http://www.flytube.com" . $t2[0];
    $t1 = explode('src="', $video);
    $t2 = explode('"', $t1[1]);
    $image = $t2[0];
    $t1 = explode('alt="', $video);
    $t2 = explode('"', $t1[1]);
    $title = htmlspecialchars_decode($t2[0]);
    $link = $host . '/scripts/adult/php/flytube_link.php?file=' . $link;
    $data = "Durata: " . str_between($video, '<div class="box-left">', "<");
    $name = preg_replace('/[^A-Za-z0-9_]/', '_', $title) . ".flv";
    echo '
    <item>
    <title>' . $title . '</title>
    <onClick>
    <script>
    showIdle();
    url="' . $link . '";
    movie=getUrl(url);
    cancelIdle();
    storagePath = getStoragePath("tmp");
    storagePath_stream = storagePath + "stream.dat";
    streamArray = null;
    streamArray = pushBackStringArray(streamArray, "");
    streamArray = pushBackStringArray(streamArray, "");
开发者ID:Lages2014,项目名称:scripts-mini,代码行数:31,代码来源:flytube.php

示例12: str_between

#!/usr/local/bin/Resource/www/cgi-bin/php
<?php 
function str_between($string, $start, $end)
{
    $string = " " . $string;
    $ini = strpos($string, $start);
    if ($ini == 0) {
        return "";
    }
    $ini += strlen($start);
    $len = strpos($string, $end, $ini) - $ini;
    return substr($string, $ini, $len);
}
$link = $_GET["file"];
$html = file_get_contents($link);
$link = str_between($html, 'file=', '&');
print $link;
开发者ID:johnymarek,项目名称:eboda-hd-for-all-500,代码行数:17,代码来源:video_alege_net_link.php

示例13: str_between

<channel>
	<title>www.990.ro - filme pe ani</title>
<?php 
function str_between($string, $start, $end)
{
    $string = " " . $string;
    $ini = strpos($string, $start);
    if ($ini == 0) {
        return "";
    }
    $ini += strlen($start);
    $len = strpos($string, $end, $ini) - $ini;
    return substr($string, $ini, $len);
}
$html = file_get_contents("http://www.990.ro");
$html = str_between($html, "Filme dupa ani", "</ul>");
$host = "http://127.0.0.1:82";
$image = "image/movies.png";
$videos = explode("<li>", $html);
unset($videos[0]);
$videos = array_values($videos);
foreach ($videos as $video) {
    $t1 = explode('a href="', $video);
    $t2 = explode('"', $t1[1]);
    $link = "http://www.990.ro/" . $t2[0];
    $pos = strlen(substr(strrchr($link, "-"), 1));
    $link = substr($link, 0, -$pos);
    $t1 = explode('title="', $video);
    $t2 = explode('"', $t1[1]);
    $title = $t2[0];
    $link = $host . "/scripts/filme/php/990_filme.php?query=," . $link;
开发者ID:johnymarek,项目名称:eboda-hd-for-all-500,代码行数:31,代码来源:990_filme1.php

示例14: explode

}
$videos = explode('<div class="itemContainer">', $html);
unset($videos[0]);
$videos = array_values($videos);
foreach ($videos as $video) {
    $t1 = explode('href="', $video);
    $t2 = explode('"', $t1[4]);
    $link = $t2[0];
    $t1 = explode('src="', $video);
    $t2 = explode('"', $t1[1]);
    $image = $t2[0];
    $t1 = explode('title="Permalink of &quot;', $video);
    $t2 = explode('&', $t1[1]);
    $title = $t2[0];
    if (strpos($link, "mp4") !== false) {
        $data = trim(str_between($video, '"postedDate">', "<"));
        $name = preg_replace('/[^A-Za-z0-9_]/', '_', $title) . ".mp4";
        echo '
	<item>
	<title>' . $title . '</title>
    <onClick>
    <script>
    showIdle();
    url="' . $link . '";
    cancelIdle();
    storagePath = getStoragePath("tmp");
    storagePath_stream = storagePath + "stream.dat";
    streamArray = null;
    streamArray = pushBackStringArray(streamArray, "");
    streamArray = pushBackStringArray(streamArray, "");
    streamArray = pushBackStringArray(streamArray, url);
开发者ID:johnymarek,项目名称:eboda-hd-for-all-500,代码行数:31,代码来源:behindkink.php

示例15: str_between

#!/usr/local/bin/Resource/www/cgi-bin/php
<?php 
function str_between($string, $start, $end)
{
    $string = " " . $string;
    $ini = strpos($string, $start);
    if ($ini == 0) {
        return "";
    }
    $ini += strlen($start);
    $len = strpos($string, $end, $ini) - $ini;
    return substr($string, $ini, $len);
}
$link = $_GET["file"];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $link);
curl_setopt($ch, CURLOPT_COOKIEFILE, '/tmp/cookies.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$h = curl_exec($ch);
curl_close($ch);
$link = str_between($h, 'vPlayer.swf?f=', '"');
$h = file_get_contents($link);
$link = str_between($h, "<src>", "</src>");
print $link;
开发者ID:johnymarek,项目名称:eboda-hd-for-all-500,代码行数:24,代码来源:jurnaltv_link.php


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