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

PHP substring函数代码示例

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

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



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

示例1: update_action

 public function update_action()
 {
     if (!$this->input->is_ajax_request()) {
         show_404();
     }
     $name = $this->input->post('name', true);
     $link = $this->input->post('link', true);
     $info = $this->input->post('info', true);
     $sort = (int) $this->input->post('sort');
     $data['name'] = trim($name);
     $data['link'] = $link;
     $data['info'] = substring(format_content($info), 240);
     $data['sort'] = $sort > 255 ? 255 : $sort;
     if (!$data['name'] or !$data['link']) {
         JSON('error', '对不起,请填写必填字段!');
     }
     if (!is_url($data['link'])) {
         JSON('error', '请填写有效的网站 URL 地址!');
     }
     $lid = (int) $this->input->post('lid');
     $this->db->update('link', $data, array('lid' => $lid));
     if ($this->db->affected_rows()) {
         JSON('success', '恭喜,链接已更新成功!');
     } else {
         JSON('error', '对不起,链接没有更新名更新失败!');
     }
 }
开发者ID:ruoL,项目名称:fun-x,代码行数:27,代码来源:link.php


示例2: parse_path

 public function parse_path($file)
 {
     if (is_string($file)) {
         if (strlen($file[0]) > 0 && $file[0] == '/') {
             $file = substring($file, 1);
         }
         return $this->get_loader_url() . $file;
     }
     return false;
 }
开发者ID:kbjr,项目名称:Resources,代码行数:10,代码来源:resource_helper.php


示例3: __construct

 /**
  * 构造函数
  * 
  * @access public
  * @return void
  */
 public function __construct()
 {
     parent::__construct();
     $p = (int) $this->input->get('p');
     $k = (string) $this->input->get('k', true);
     $this->_page = $p === 0 ? 1 : $p;
     $this->_keys = $this->_safereplace(substring(trim($k), 32, false));
     if (empty($this->_keys)) {
         show_404();
     }
 }
开发者ID:ruoL,项目名称:fun-x,代码行数:17,代码来源:search.php


示例4: combine

 public function combine($form1, $form2, $act2)
 {
     if ($act2 == null) {
         // Ex.:  _k + paaq > _paaq
         return substring($form1, 0, strlen($form1) - 1) . $form2;
     } else {
         $act2Type = -1;
         $act2Type = $act2->type();
         if ($act2Type == Action::NULLACTION) {
             // Ex.:  _k + paaq > _paaq
             return substr($form1, 0, strlen($form1) - 1) . $form2;
         } elseif ($act2Type == Action::DELETION) {
             // Ex.:  _VVk + ilitaq > _Vilitaq
             return substr($form1, 0, strlen($form1) - 2) . $form2;
         } elseif ($act2Type == Action::SELFDECAPITATION) {
             // Ex.: _VVk + uqqaq > _VVqqaq
             return substr($form1, 0, strlen($form1) - 1) . substr($form2, 1);
         } elseif ($act2Type == Action::INSERTION) {
             // Ex.: _VVq + u > _VVngu
             return substr($form1, 0, strlen($form1) - 1) . $act2->getInsert() . $form2;
         } elseif ($act2Type == Action::SPECIFICDELETION) {
             // Ex.: _Vaq + it > _Vit
             return substr($form1, 0, strlen($form1) - 2) . $form2;
         } else {
             return "";
         }
     }
 }
开发者ID:nrc-cnrc,项目名称:InuktitutToolkit,代码行数:28,代码来源:DeletionAction.php


示例5: update_action

 public function update_action()
 {
     if (!$this->input->is_ajax_request()) {
         show_404();
     }
     $cid = (int) $this->input->post('cid');
     if ($cid === 0) {
         JSON('error', '对不起,更新分类提交失败!');
     }
     $name = $this->input->post('name', true);
     $link = $this->input->post('link', true);
     $keyword = $this->input->post('keyword', true);
     $description = $this->input->post('description', true);
     $sort = (int) $this->input->post('sort');
     $data['name'] = trim($name);
     $data['link'] = url_title($link, 'underscore', true);
     $data['sort'] = $sort > 255 ? 255 : $sort;
     $data['keyword'] = format_keyword($keyword);
     $data['description'] = substring(format_content($description), 240);
     if (!$data['name'] or !$data['link']) {
         JSON('error', '对不起,请填写必填字段!');
     }
     if ($this->category_model->get_info(array('cid !=' => $cid, 'name' => $name))) {
         JSON('error', '对不起,分类名称已经存在!');
     }
     if ($this->category_model->get_info(array('cid !=' => $cid, 'link' => $link))) {
         JSON('error', '对不起,分类链接名称已经存在!');
     }
     $this->db->update('category', $data, array('cid' => $cid));
     if ($this->db->affected_rows()) {
         JSON('success', '恭喜,分类 ' . $data['name'] . ' 更新成功!');
     } else {
         JSON('error', '对不起,分类没有更新或更新失败!');
     }
 }
开发者ID:ruoL,项目名称:fun-x,代码行数:35,代码来源:category.php


示例6: substring

</td>
        <td><?php 
        echo $item['command'];
        ?>
</td>
        <td><?php 
        echo $item['time'];
        ?>
&nbsp;</td>
        <td><?php 
        echo $item['status'];
        ?>
&nbsp;</td>
        <td>
		<div class="message_head"><span class="message_icon"><i class="icon-plus"></i></span><cite><?php 
        echo substring($item['info'], 0, 40);
        ?>
:</cite></div>
		<div class="message_body" style="width: 300px;">
			<pre><span style="color: blue;"><?php 
        echo $item['info'];
        ?>
</span></pre>
		</div>
        </td>
        <td><?php 
        echo $item['host'];
        ?>
:<?php 
        echo $item['port'];
        ?>
开发者ID:noikiy,项目名称:MySQL-monitor,代码行数:31,代码来源:process.php


示例7: foreach

if (!empty($datalist)) {
    ?>
 <?php 
    foreach ($datalist as $item) {
        ?>
    <tr style="font-size: 12px;">
        <td><a href="<?php 
        echo site_url('slowquery/detail/' . $item['checksum'] . '/' . $setval['server_id']);
        ?>
" target="_blank"  title="点击进入详情"><?php 
        echo $item['checksum'];
        ?>
</a></td>
         <td>
         <div class="message_head"><span class="message_icon"><i class="icon-plus"></i></span><cite><?php 
        echo substring($item['fingerprint'], 0, 40);
        ?>
:</cite></div>
		<div class="message_body" style="width: 300px;">
			<pre><span style="color: blue;"><?php 
        echo $item['fingerprint'];
        ?>
</span></pre>
		</div>
        
        <td><?php 
        echo $item['last_seen'];
        ?>
</td>
        <td><?php 
        echo $item['ts_cnt'];
开发者ID:chen-123,项目名称:phper,代码行数:31,代码来源:index.php


示例8: wee_process_weeSet

function wee_process_weeSet($keyval, $wee)
{
    $key = trim(substring($keyval, 0, strpos($keyval, '=')));
    $val = trim(substring($keyval, strpos($keyval, '=') + 1, 999));
    $wee[$key] = $val;
}
开发者ID:jomosome,项目名称:wee-templating,代码行数:6,代码来源:wee.inc.php


示例9: View


//.........这里部分代码省略.........
        }
        ?>
>程序反馈影片无法播放</option>
	<option value="1" <?php 
        if ($i == "1") {
            echo "selected";
        }
        ?>
>用户反馈影片无法播放</option>
	<option value="2" <?php 
        if ($i == "2") {
            echo "selected";
        }
        ?>
>用户反馈影片播放不流畅</option>
	<option value="3" <?php 
        if ($i == "3") {
            echo "selected";
        }
        ?>
>用户反馈影片加载比较慢</option>
	<option value="4" <?php 
        if ($i == "4") {
            echo "selected";
        }
        ?>
>用户反馈影片不能下载</option>
	<option value="5" <?php 
        if ($i == "5") {
            echo "selected";
        }
        ?>
>用户反馈观看影片时出现闪退</option>
	<option value="6" <?php 
        if ($i == "6") {
            echo "selected";
        }
        ?>
>用户反馈画质不清晰</option>
	<option value="7" <?php 
        if ($i == "7") {
            echo "selected";
        }
        ?>
>用户反馈音画不同步</option>
	<option value="8" <?php 
        if ($i == "8") {
            echo "selected";
        }
        ?>
>用户反馈其它(用户自己填写,可不填)</option>
	<option value="10" <?php 
        if ($i == "10") {
            echo "selected";
        }
        ?>
>程序反馈视频地址失效</option>
	</select></td>
	<td><?php 
        echo $db->getOne("select count(*) as count from tbl_video_feedback where feedback_type like '%" . $i . "%' and prod_id=" . $d_id);
        ?>
</td>
	</tr>
 <?php 
    }
    ?>
</table>
<table class="admin_vod_feedback tb" width="50%">
	<tr>
	<td colspan="3">反馈类别:其它(用户自己填写,可不填)</td>
	</tr>
	<tr>
	<td  width="5%"></td>
	<td>反馈时间</td>
	<td>反馈内容</td>
	</tr>
	
	<?php 
    $rs = $db->query("select * from tbl_video_feedback where feedback_type like '%8%' and prod_id=" . $d_id);
    while ($row = $db->fetch_array($rs)) {
        ?>
      <tr><td  width="5%"></td>
		<td width="40%"><?php 
        echo isToday($row["create_date"]);
        ?>
</td>
		<td><?php 
        echo substring($row["feedback_memo"], 20);
        ?>
</td>
	 </tr>
    <?php 
    }
    unset($rs);
    ?>
	</table>
<?php 
    echo '</body>
</html>';
}
开发者ID:andyongithub,项目名称:joyplus-cms,代码行数:101,代码来源:admin_vod_feedback.php


示例10: showErr

    } else {
        if (substring($path, 11) != '../template' || count(explode('../', $path)) > 2) {
            showErr('System', '非法目录请求');
            return;
        }
        $extarr = array('.html', '.htm', '.js', '.xml', '.wml');
        if (!in_array($suffix, $extarr)) {
            $suffix = '.html';
        }
        fwrite(fopen($path . '/' . $filename . $suffix, 'wb'), $filecontent);
    }
    showMsg('文件内容保存完毕', '');
} elseif ($method == 'del') {
    $file = $p['file'];
    $file = str_replace('\\', '/', $file);
    if (substring($file, 11) != '../template' || count(explode('../', $file)) > 2) {
        showErr('System', '非法目录请求');
        return;
    }
    if (file_exists($file)) {
        unlink($file);
    }
    redirect(getReferer());
} elseif ($method == 'ads') {
    $path = '../template/' . $MAC['site']['templatedir'] . '/' . $MAC['site']['adsdir'] . '/';
    if (!is_dir($path)) {
        showErr('System', '未找到指定系统路径:' . $path);
        return;
    }
    $plt->set_file('main', $ac . '_' . $method . '.html');
    $fcount = 0;
开发者ID:klarclm,项目名称:sgv,代码行数:31,代码来源:template.php


示例11: MovieInflow


//.........这里部分代码省略.........
        $rs_collect2 = $db->query($sql2);
        $mrowurl = $db->fetch_array($rs_collect2);
        //插入新数据开始
        if (isN($rowvod["d_id"]) || be("post", "CCTV") == "1") {
            $flag = true;
            $d_pic = replaceStr($row["m_pic"], "'", "''");
            $d_pic_ipad = replaceStr($row["d_pic_ipad"], "'", "''");
            $d_addtime = date('Y-m-d H:i:s', time());
            $d_year = $row["m_year"];
            if (isN($d_year) || $d_year === '未知') {
                $d_year = '其他';
            }
            $d_content = $row["m_content"];
            $d_hits = $row["m_hits"];
            $d_area = $row["m_area"];
            if (isN($d_area) || $d_area === '未知') {
                $d_area = '其他';
            }
            $d_remarks = $row["m_remarks"];
            if (!isNum($d_remarks)) {
                $d_remarks = '';
            }
            $d_state = $row["m_state"];
            $d_starring = $row["m_starring"];
            $d_directed = $row["m_directed"];
            $duraning = $row["duraning"];
            $d_name = $title;
            $typeName = $row["m_type"];
            if (isN($typeName) || $typeName === '未知') {
                $typeName = '其他';
            }
            $d_enname = hanzi2pinyin($d_name);
            $d_capital_name = Hanzi2PinYin_Captial($d_name);
            $d_letter = strtoupper(substring($d_enname, 1));
            if ($row["m_typeid"] > 0) {
                $d_type = $row["m_typeid"];
            } else {
                if (!isN($row["m_type"])) {
                    $sql = "select * from {pre}vod_type where t_name like '%" . $row["m_type"] . "%' ";
                    $rowtype = $db->getRow($sql);
                    if ($rowtype) {
                        $d_type = $rowtype["t_id"];
                    }
                    unset($rowtype);
                }
            }
            if (!($d_type === '1' || $d_type === 1)) {
                $duraning = '';
            }
            if (isN($mrowurl["iso_video_url"]) && isN($mrowurl["android_vedio_url"])) {
                //判断下载地址 无
                if ($row["m_playfrom"] == "qq" || $row["m_playfrom"] == "pptv") {
                    $strSet .= "can_search_device='iPad,iphone,apad,aphone,web' , ";
                    //入库  不勾tv.vender
                    echo "qq和pptv播放源直接入库   视频名称: \"" . $title . "\"  播放源: " . $row["m_playfrom"] . "\";";
                }
            } else {
                // 判断下载地址 有
                if ($row["m_playfrom"] == "youku") {
                    // 入库数据是优酷
                    $strSet .= "can_search_device='TV,Vendor' , ";
                    //入库 勾选tv vendor
                } else {
                    $strSet .= "can_search_device='TV,iPad,iphone,apad,aphone,web,Vendor' , ";
                    //入库 全部勾选
                }
开发者ID:andyongithub,项目名称:joyplus-cms,代码行数:67,代码来源:collect_vod.php


示例12: substring

exit;
// course information
$output = substring($output, "<div id=\"content\">", "<div id=\"footer\">");
$courseInfo = substring($output, "<table width=100% border=0 cellpadding=1 cellspacing=1>", "<!-- Display ONLY if not EMBA -->");
$courseInfo = substring($courseInfo, "<table>", "</table>");
$fCourseInfo = validateHTML($courseInfo);
printCourseInfo($fCourseInfo);
// grades information
$str = "<!-- Display ONLY if not EMBA -->";
$gradesInfo = substr($output, stripos($output, $str) + strlen($str));
$fGradesInfo = validateHTML(substring($gradesInfo, "<table border=0 cellpadding=1 cellspacing=1>", $str));
$fGradesInfo = substring($fGradesInfo, "<table>", "</table>");
printGradesInfo($fGradesInfo);
// detailed information
$detailed = substring($gradesInfo, "<table border=0 cellpadding=1 cellspacing=0>", "<p><br>");
$detailed = substring($detailed, "<table>", "</table>");
$fDetailed = validateHTML($detailed);
printDetailed($fDetailed);
curl_close($ch);
function printCourseInfo($xmlString)
{
    $xml = new SimpleXMLELement($xmlString);
    print "<p>";
    $i = 0;
    foreach ($xml->tr as $tr) {
        $j = 0;
        foreach ($tr->td as $td) {
            $class = $j == 0 ? "title" : "value";
            if ($i == 3) {
                $a = $td->a;
                if ($a != "") {
开发者ID:rickyc,项目名称:whatchamacallit,代码行数:31,代码来源:stern_eval.php


示例13: MovieInflow

function MovieInflow($sql_collect, $MovieNumW)
{
    global $db;
    ?>
<table class=tb>
	<tr>
		<td  colspan="2" align="center"> 入 库 状 态 </td>
		<div id="refreshlentext" style="background:#006600"></div>
		</td>
	</tr>
  	<tr>
		<td  colspan="2" align="center"><span id="storagetext">正 在 入 库...</span></td>
  	</tr>
</table>
<?php 
    $iscover = be("iscover", "get");
    $rs = $db->query($sql_collect);
    $rscount = $db->num_rows($rs);
    //	var_dump($rscount);
    if ($rscount == 0) {
        echo "<script>alert('没有可入库的数据!'); location.href='collect_vod.php';</script>";
        exit;
    }
    if ($rscount > 10000) {
        $rscount = 1000;
    } elseif ($rscount > 5000) {
        $rscount = 500;
    } elseif ($rscount > 1000) {
        $rscount = 100;
    } else {
        $rscount = 10;
    }
    while ($row = $db->fetch_array($rs)) {
        if (!(isset($row["m_playfrom"]) && !is_null($row["m_playfrom"]) && strlen(trim($row["m_playfrom"])) > 0)) {
            continue;
        }
        if (isset($row["m_playfrom"]) && !is_null($row["m_playfrom"]) && ($row["m_playfrom"] === 'cntv' || $row["m_playfrom"] === 'wasu' || $row["m_playfrom"] === 'kankan' || $row["m_playfrom"] === 'tudou' || $row["m_playfrom"] === '')) {
            continue;
        }
        $flag = false;
        $title = $row["m_name"];
        $d_type = $row["m_typeid"];
        $title = replaceStr($title, "&lt;", "<<");
        $title = replaceStr($title, "&gt;", ">>");
        $testUrl = $row["m_urltest"];
        $year = $row['m_year'];
        $title = replaceStr($title, "'", "''");
        $strSet = "";
        $sql = "SELECT * FROM {pre}vod WHERE d_name = '" . $title . "' and d_type = '" . $d_type . "' ";
        $rowvod = $db->getRow($sql);
        if (!isN($rowvod["d_status"]) && ($rowvod["d_status"] === 1 || $rowvod["d_status"] === '1')) {
            var_dump($title . " is locked");
            continue;
        }
        //插入新数据开始
        if (isN($rowvod["d_id"]) || be("post", "CCTV") == "1") {
            $flag = true;
            $d_pic = replaceStr($row["m_pic"], "'", "''");
            $d_addtime = date('Y-m-d H:i:s', time());
            $d_year = $row["m_year"];
            $d_content = $row["m_content"];
            $d_hits = $row["m_hits"];
            $d_area = $row["m_area"];
            $d_language = $row["m_language"];
            $d_remarks = $row["m_remarks"];
            $d_state = $row["m_state"];
            $d_starring = $row["m_starring"];
            $d_directed = $row["m_directed"];
            $d_name = $title;
            $d_enname = hanzi2pinyin($d_name);
            if (isN($d_letter)) {
                $d_letter = strtoupper(substring($d_enname, 1));
            }
            if ($row["m_typeid"] > 0) {
                $d_type = $row["m_typeid"];
            } else {
                if (!isN($row["m_type"])) {
                    $sql = "select * from {pre}vod_type where t_name like '%" . $row["m_type"] . "%' ";
                    $rowtype = $db->getRow($sql);
                    if ($rowtype) {
                        $d_type = $rowtype["t_id"];
                    }
                    unset($rowtype);
                }
            }
            $sql = "insert {pre}vod (d_type_name,d_type,d_pic,d_addtime,d_time,d_year,d_content,d_hits,d_area,d_language,d_name,d_enname,d_starring,d_directed,d_state,d_remarks) values('" . $row["m_type"] . "','" . $d_type . "','" . $d_pic . "','" . $d_addtime . "','" . $d_addtime . "','" . $d_year . "','" . $d_content . "','" . $d_hits . "','" . $d_area . "','" . $d_language . "','" . $d_name . "','" . $d_enname . "','" . $d_starring . "','" . $d_directed . "','" . $d_state . "','" . $d_remarks . "') ";
            $db->query($sql);
            $did = $db->insert_id();
        } else {
            //同名不处理, 如果是电影也不更新
            if (be("post", "CCTV") == "3" || $d_type === '1' || $d_type == 1) {
                //var_dump("dd");
                continue;
            }
            //更新数据开始
            if ($row["m_typeid"] > 0) {
                $d_type = $row["m_typeid"];
            } else {
                if (!isN($row["m_type"])) {
                    $sql = "select * from {pre}vod_type where t_name like '%" . $row["m_type"] . "%' ";
//.........这里部分代码省略.........
开发者ID:andyongithub,项目名称:joyplus-cms,代码行数:101,代码来源:collect_vod.php


示例14: substring

        ?>
</td>
        <td><?php 
        echo substring($item['Query_time_max'], 0, 5);
        ?>
</td>
        <td><?php 
        echo substring($item['Lock_time_sum'], 0, 6);
        ?>
</td>
        <td><?php 
        echo substring($item['Lock_time_min'], 0, 7);
        ?>
</td>
        <td><?php 
        echo substring($item['Lock_time_max'], 0, 7);
        ?>
</td>
	</tr>
 <?php 
    }
} else {
    ?>
<tr>
<td colspan="10">
<font color="red"><?php 
    echo $this->lang->line('no_record');
    ?>
</font>
</td>
</tr>
开发者ID:hisery,项目名称:Lepus-1,代码行数:31,代码来源:slowquery.php


示例15: intval

 $d_state = intval($array3[$xn_d_state][$key]);
 $d_type = $xt == '0' ? $array3[$xn_d_type][$key] : $flag . $array3[$xn_d_type][$key];
 $d_type = intval($bindcache[$d_type]);
 $d_starring = htmlspecialchars_decode($array3[$xn_d_starring][$key]);
 $d_directed = htmlspecialchars_decode($array3[$xn_d_directed][$key]);
 $d_pic = $array3[$xn_d_pic][$key];
 $d_time = $array3[$xn_d_time][$key];
 $d_year = intval($array3[$xn_d_year][$key]);
 $d_area = $array3[$xn_d_area][$key];
 $d_lang = $array3[$xn_d_lang][$key];
 $d_content = htmlspecialchars_decode($array3[$xn_d_content][$key]);
 $d_playurls = htmlspecialchars_decode($array3[$xn_d_urls][$key]);
 $d_playurls = str_replace("'", "''", $d_playurls);
 preg_match_all($xn_url, $d_playurls, $array4);
 $d_enname = Hanzi2PinYin($d_name);
 $d_letter = strtoupper(substring($d_enname, 1));
 $d_addtime = time();
 $d_time = $d_addtime;
 $d_hitstime = "";
 $d_hits = rand($MAC['collect']['vod']['hitsstart'], $MAC['collect']['vod']['hitsend']);
 $d_dayhits = rand($MAC['collect']['vod']['hitsstart'], $MAC['collect']['vod']['hitsend']);
 $d_weekhits = rand($MAC['collect']['vod']['hitsstart'], $MAC['collect']['vod']['hitsend']);
 $d_monthhits = rand($MAC['collect']['vod']['hitsstart'], $MAC['collect']['vod']['hitsend']);
 $d_scorenum = rand(1, 500);
 $d_scoreall = $d_scorenum * rand(1, 10);
 $d_score = round($d_scoreall / $d_scorenum, 1);
 $d_hide = $MAC['collect']['vod']['hide'];
 if ($MAC['collect']['vod']['psernd'] == 1) {
     $d_content = repPseRnd('vod', $d_content, $i);
 }
 if ($MAC['collect']['vod']['psesyn'] == 1) {
开发者ID:klarclm,项目名称:sgv,代码行数:31,代码来源:collect.php


示例16: cjView


//.........这里部分代码省略.........
                        $flag = false;
                    }
                }
                //		var_dump($weburl);
                //		if ($p_playlinktype >0) {
                //			$weburl = getArray($playcode,$p_playlinkstart,$p_playlinkend);
                //		}
                //		else{
                //			$weburl = getArray($playcode,$p_playurlstart,$p_playurlend);
                //		//	var_dump($playcode);
                //		}
                //		if ($p_setnametype == 3) {
                //			$setnames = getArray($playcode,$p_setnamestart,$p_setnameend);
                //		}
            } else {
                if ($p_playlinktype > 0) {
                    $weburl = getArray($strViewCode, $p_playlinkstart, $p_playlinkend);
                    //				var_dump($weburl);
                } else {
                    $weburl = getArray($strViewCode, $p_playurlstart, $p_playurlend);
                    $androidUrl = ContentProviderFactory::getContentProvider($p_playtype)->parseAndroidVideoUrlByContent($strViewCode, $p_coding, $p_script);
                    $videoAddressUrl = ContentProviderFactory::getContentProvider($p_playtype)->parseIOSVideoUrlByContent($strViewCode, $p_coding, $p_script);
                    writetofile("android_log.txt", $strlink . '{===}' . $androidUrl . '{===}' . $videoAddressUrl);
                }
                if ($p_setnametype == 3) {
                    $setnames = getArray($strViewCode, $p_setnamestart, $p_setnameend);
                }
            }
        }
        if ($p_showtype == 1) {
            if ($p_savefiles == 1) {
                $filename = time() . $num;
                if (strpos($piccode, ".jpg") || strpos($piccode, ".bmp") || strpos($piccode, ".png") || strpos($piccode, ".gif")) {
                    $extName = substring($piccode, 4, strlen($piccode) - 4);
                } else {
                    $extName = ".jpg";
                }
                $picpath = "upload/vod/" . getSavePicPath() . "/";
                $picfile = $filename . $extName;
                //echo "<tr><td width=\"20%\" >自动下载图片:</td><td><iframe border=\"0\" valign=\"bottom\" vspace=\"0\" hspace=\"0\" marginwidth=\"0\" marginheight=\"0\" framespacing=\"0\" frameborder=\"0\" scrolling=\"no\" width=\"400\" height=\"15\" src=\"../admin_pic.php?action=downpic&wjs=1&path=../".$picpath."&file=".$picfile."&url=".$piccode."\"></iframe></td></tr>";
                $piccode = $picpath . $picfile;
            }
        } else {
            //		echo "<tr><td colspan=\"2\" align=\"center\">第".($num+1)."条数据采集结果</td></tr><tr><td width=\"20%\" >来源:</td><td >".$strlink."</td></tr><tr><td width=\"20%\" >名称:</td><td >".$titlecode." 连载:".$lzcode." 备注:".$remarkscode."</td></tr>";
        }
        if ($weburl == false) {
            //			echo "<tr><td colspan=\"2\">在获取播放列表链接时出错 ".$strlink." / '.$strListUrl.'</TD></TR>";
            writetofile("crawel_auto_error.log", $p_id . '{=====}' . $strlink . '{=====}' . $strListUrl);
            //			$sb=$sb+1;
            return;
        } else {
            $sql = "select m_id,m_name,m_type,m_area,m_playfrom,m_starring,m_directed,m_pic,m_content,m_year,m_addtime,m_urltest,m_zt,m_pid,m_typeid,m_hits,m_playserver,m_state from {pre}cj_vod where  m_pid='" . $p_id . "' and m_name='" . $titlecode . "'  order by m_id desc";
            $rowvod = $db->getRow($sql);
            if ($rowvod) {
                $cg = $cg + 1;
                $movieid = $rowvod["m_id"];
                if (isN($titlecode)) {
                    $titlecode = $rowvod["m_name"];
                }
                if (isN($starringcode)) {
                    $starringcode = $rowvod["m_starring"];
                }
                if (isN($piccode)) {
                    $piccode = $rowvod["m_pic"];
                }
                $sql = "update {pre}cj_vod set m_pic='" . $piccode . "', m_type='" . $typecode . "',m_area='" . $areacode . "',m_urltest='" . $strlink . "',m_name='" . $titlecode . "',m_starring='" . $starringcode . "',m_directed='" . $directedcode . "',m_year='" . $timecode . "',m_playfrom='" . $p_playtype . "',m_content='" . $contentcode . "',m_addtime='" . date('Y-m-d H:i:s', time()) . "',m_zt='0',m_pid='" . $p_id . "',m_typeid='" . $m_typeid . "',m_playserver='" . $p_server . "',m_state='" . $lzcode . "',m_language='" . $languagecode . "',m_remarks='" . $remarkscode . "' where m_id=" . $rowvod["m_id"];
开发者ID:andyongithub,项目名称:joyplus-cms,代码行数:67,代码来源:auto_collect_vod_cj.php


示例17: ob_end_clean

<?php

ob_end_clean();
ob_implicit_flush(true);
require_once "admin_conn.php";
require_once "version.php";
chkLogin();
$action = be("get", "action");
$updateserver = "";
$updatelog = "bak/update.xml";
$verstr = getPage($updateserver . "?v=" . version, "utf-8");
$adpath = $_SERVER["SCRIPT_NAME"];
$adpath = substring($adpath, strripos($adpath, "/"));
$n = strripos($adpath, "/");
$adpath = substring($adpath, strlen($adpath) - $n, $n + 1) . "/";
switch ($action) {
    case "checkversion":
        checkversion();
        break;
    case "showfilelist":
        headAdmin("更新列表");
        showfilelist();
        break;
    case "showfile":
        headAdmin("更新列表");
        showfile();
        break;
}
dispseObj();
function checkversion()
{
开发者ID:andyongithub,项目名称:joyplus-cms,代码行数:31,代码来源:admin_update.php


示例18: fclose

            fclose($f);
            /*$f = fopen("../output/" . $_POST['ques-name'].".txt",'w');
              fclose($f);*/
            echo "<h1>" . $_POST['ques-name'] . "</h1>";
            move_uploaded_file($_FILES["output-file"]["tmp_name"], "../output/temp.txt");
            /*
             *create multiple test cases
             */
            $f = fopen("../output/temp.txt", 'r');
            $cases = 0;
            while (!feof($f)) {
                $temp = fgets($f);
                if (substring($temp, "#Test") || substring($temp, "#test")) {
                    $case_file = fopen("../output/" . $_POST['ques-name'] . "/" . $cases . ".txt", 'w');
                    $line = fgets($f);
                    while (!substring($line, "#end")) {
                        fwrite($case_file, $line);
                        $line = fgets($f);
                    }
                    fclose($case_file);
                    $cases++;
                }
            }
            fclose($f);
            header("Location: adminhome.php?id=1");
        }
    }
    //header("Location: adminhome.php?id=3");//id = 3 is for updation
}
?>
</div>
开发者ID:thezawad,项目名称:LearnCode,代码行数:31,代码来源:editques.php


示例19: array

                 $db->Update('{pre}vod', array('d_topic'), array($d_topic), 'd_id=' . $id);
             }
         } elseif ($flag == 'del') {
             $sql = 'delete from {pre}vod_relation where r_type=2 and r_a=' . $tid . ' and r_b=' . $id;
             $db->query($sql);
             $sql = 'update {pre}vod set d_topic=replace(d_topic,\'' . $tid . '\',\'\') where d_id=' . $id;
             $db->query($sql);
         }
         $sql = 'select d_id,d_name,d_enname,d_type,d_starring from {pre}vod_relation t inner join {pre}vod d on d.d_id=t.r_b where t.r_type=2 and t.r_a=' . $tid;
     }
     $rs = $db->queryArray($sql, false);
     for ($i = 0; $i < count($rs); $i++) {
         $typearr = $GLOBALS['MAC_CACHE'][$tab . 'type'][$rs[$i][$pre . 'type']];
         $alink = "../" . $tpl->getLink($tab, 'detail', $typearr, $rs[$i], true);
         $alink = str_replace("../" . $MAC['site']['installdir'], "../", $alink);
         if (substring($alink, 1, strlen($alink) - 1) == "/") {
             $alink .= "index." . $MAC['app']['suffix'];
         }
         $rs[$i][$pre . 'link'] = $alink;
     }
     $str = json_encode($rs);
     if ($str != '[]') {
         echo $str;
         return;
     }
     echo '[]';
 } elseif ($ac == 'typenow') {
     if ($tab == 'art') {
         $pre = 'a';
     } else {
         $pre = 'd';
开发者ID:klarclm,项目名称:sgv,代码行数:31,代码来源:admin_data.php


示例20: printPath

function printPath($path, $isHrefEnd = false)
{
    $html = null;
    if ($path != null && $path != '/' && strpos($path, '/') !== false) {
        $array = explode('/', preg_replace('|^/(.*?)$|', '\\1', $path));
        $item = null;
        $url = null;
        foreach ($array as $key => $entry) {
            if ($key === 0) {
                $seperator = preg_match('|^\\/(.*?)$|', $path) ? '/' : null;
                $item = $seperator . $entry;
            } else {
                $item = '/' . $entry;
            }
            if ($key < count($array) - 1 || $key == count($array) - 1 && $isHrefEnd) {
                $html .= '<span class="path_seperator">/</span><a href="index.php?dir=' . rawurlencode($url . $item) . '">';
            } else {
                $html .= '<span class="path_seperator">/</span>';
            }
            $url .= $item;
            $html .= '<span class="path_entry">' . substring($entry, 0, NAME_SUBSTR, NAME_SUBSTR_ELLIPSIS) . '</span>';
            if ($key < count($array) - 1 || $key == count($array) - 1 && $isHrefEnd) {
                $html .= '</a>';
            }
        }
    }
    return $html;
}
开发者ID:TauThickMi,项目名称:M,代码行数:28,代码来源:function.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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