當前位置: 首頁>>代碼示例>>PHP>>正文


PHP skip函數代碼示例

本文整理匯總了PHP中skip函數的典型用法代碼示例。如果您正苦於以下問題:PHP skip函數的具體用法?PHP skip怎麽用?PHP skip使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了skip函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: extract_columns

function extract_columns(&$columns, $file, $length)
{
    $fp = fopen($file, 'r');
    $index = 0;
    $z = 0;
    $mu = 0;
    $dmu = 0;
    while ($cols = fgetcsv($fp, 1024, ",")) {
        if (empty($cols[0])) {
            continue;
        }
        $pm_count = substr_count($cols[0], "±");
        if ($pm_count > 1) {
            $index += $pm_count - 1;
            $cols[0] = trim(skip($cols[0], " ", 4 * ($pm_count - 1)));
            echo $cols[0] . "\n";
        }
        if ($index == 1) {
            $z = $cols[0];
        }
        if ($index == 6) {
            $mu = (double) $cols[0];
            $dmu = trim(substr($cols[0], strpos($cols[0], "±") + 2));
        }
        if ($index >= $length - 1) {
            $index = 0;
            $columns[] = array($z, $mu, $dmu);
        } else {
            ++$index;
        }
    }
}
開發者ID:RichardTaillet,項目名稱:Cosmologie,代碼行數:32,代碼來源:parse_csv.php

示例2: test_skip_one

 function test_skip_one()
 {
     $input = [0, 1, 2];
     $expect = [1 => 1, 2 => 2];
     $skip = skip(1);
     $actual = iterator_to_array($skip($input));
     $this->assertEquals($expect, $actual);
 }
開發者ID:ChineseDron,項目名稱:Algorithm,代碼行數:8,代碼來源:SkipTest.php

示例3: setup

 function setup()
 {
     if (!extension_loaded('apc')) {
         skip('apc required.');
     }
     if (!ini_get('apc.enable_cli')) {
         skip('apc.enable_cli required');
     }
 }
開發者ID:c9s,項目名稱:roller,代碼行數:9,代碼來源:RouterApcTest.php

示例4: setUp

 function setUp()
 {
     if (!extension_loaded('geoip')) {
         skip('geoip extension is required.');
     }
     if (!dns_get_record('www.hinet.net')) {
         skip('networking is required.');
     }
 }
開發者ID:azole,項目名稱:Phifty,代碼行數:9,代碼來源:BrowserClientTest.php

示例5: testDetectProcessorNumber

 public function testDetectProcessorNumber()
 {
     $machine = new MachineForTest();
     if (!$machine->detectProcessorNumber()) {
         skip();
     }
     ok($machine->detectProcessorNumber() > 0);
     is($machine->detectProcessorNumber(), $machine->detectProcessorNumberByNproc() || $machine->detectProcessorNumberByGrep());
 }
開發者ID:nanasess,項目名稱:phpbrew,代碼行數:9,代碼來源:MachineTest.php

示例6: test_skip_all

 function test_skip_all()
 {
     $skip = skip(function ($value) {
         return $value % 2 > 0;
     });
     $input = [1, 3, 5];
     $expect = [];
     $actual = iterator_to_array($skip($input));
     $this->assertEquals($expect, $actual);
 }
開發者ID:morrisonlevi,項目名稱:algorithm,代碼行數:10,代碼來源:SkipTest.php

示例7: test

 public function test()
 {
     if (!TputConsoleInfo::hasSupport()) {
         skip('tput is not supported.');
     }
     $info = new TputConsoleInfo();
     ok($info);
     ok($info->getColumns());
     ok($info->getRows());
 }
開發者ID:arunahk,項目名稱:CLIFramework,代碼行數:10,代碼來源:TputConsoleInfoTest.php

示例8: test

 public function test()
 {
     if (!EnvConsoleInfo::hasSupport()) {
         skip('env console info is not supported.');
     }
     $info = new EnvConsoleInfo();
     ok($info);
     ok($info->getColumns());
     ok($info->getRows());
 }
開發者ID:arunahk,項目名稱:CLIFramework,代碼行數:10,代碼來源:EnvConsoleInfoTest.php

示例9: _registerAct

 /**
  *  注冊
  */
 public function _registerAct()
 {
     if (empty($_POST) || empty($_POST['mobile']) || empty($_POST['pwd'])) {
         return 0;
     }
     $phone = V('mobile');
     $pwd = $_POST['pwd'];
     $rec = V('recommended');
     $telcode = V('telcode');
     $data = array('sname' => 'user.reg', 'mobile' => $phone, 'passwd' => $pwd, 'recommended' => $rec, 'telcode' => $telcode);
     $data = transferAPI($data);
     if ($data['code'] != 0) {
         $this->view->assign('n', $phone);
         $this->view->assign('msg', $data['msg']);
     } else {
         skip('/user/login');
     }
 }
開發者ID:GStepOne,項目名稱:CI,代碼行數:21,代碼來源:class.act.index.php

示例10: zpm_postamble

function zpm_postamble($ggame)
{
    if (skip()) {
        return;
    }
    global $zpm_utime;
    $end_t = microtime(true);
    $time_t = floor(($end_t - $zpm_utime) * 1000000);
    $start_t_f = floor($zpm_utime);
    $name = basename($_SERVER['SCRIPT_NAME']);
    if (isset($ggame) && $ggame != "") {
        $name = $ggame . "^" . $name;
    }
    log_entry($name, $time_t, $start_t_f);
    zperfmon_disable();
    $zpm_utime = ZPM_INIT_VAL;
    return;
}
開發者ID:shourya07,項目名稱:zperfmon,代碼行數:18,代碼來源:zpm_util.inc.php

示例11: _loginAct

 public function _loginAct()
 {
     $phone = V('mobile');
     $pas = $_POST['pwd'];
     if (empty($phone) || empty($pas)) {
         return 0;
     }
     $data = array('sname' => 'user.login', 'mobile' => $phone, 'passwd' => $pas);
     core::Singleton('comm.remote.remote');
     $result = remote::send($data);
     setcookie("version", remote::$session_id, time() + 3600 * 12, '/', 'cailai.com');
     $data = json_decode($result, TRUE);
     if ($data['code'] != 0) {
         $this->view->assign('tipMsg', $data['msg']);
     }
     setcookie("uid", md5(uniqid()) . $data['data']['mobile'], time() + 3600 * 12, '/', 'cailai.com');
     if (empty(remote::$session_id)) {
         $this->view->assign('n', $phone);
         return 0;
     } else {
         skip();
     }
 }
開發者ID:GStepOne,項目名稱:CI,代碼行數:23,代碼來源:class.act.user.php

示例12: connect

include_once 'inc/config.inc.php';
include_once 'inc/mysql.inc.php';
include_once 'inc/tool.inc.php';
$link = connect();
if (!($member_id = is_login($link))) {
    skip('login.php', 'error', '請登錄之後再發帖!');
}
if (isset($_POST['submit'])) {
    include 'inc/check_publish.inc.php';
    $_POST = escape($link, $_POST);
    $query = "insert into cfc_content(module_id,title,content,time,member_id) values({$_POST['module_id']},'{$_POST['title']}','{$_POST['content']}',now(),{$member_id})";
    execute($link, $query);
    if (mysqli_affected_rows($link) == 1) {
        skip('publish.php', 'ok', '發布成功!');
    } else {
        skip('publish.php', 'error', '發布失敗,請重試!');
    }
}
$template['title'] = '帖子發布頁';
$template['css'] = array('style/public.css', 'style/publish.css');
include 'inc/header.inc.php';
?>
	<div id="position" class="auto">
		 <a href="index.php">首頁</a> &gt; 發布帖子
	</div>
	<div id="publish">
		<form method="post">
			<select name="module_id">
				<option value='-1'>請選擇一個子版塊</option>
				<?php 
$where = '';
開發者ID:sakuraliu,項目名稱:bbs,代碼行數:31,代碼來源:publish.php

示例13: execute

$result_memebr = execute($link, $query);
$data_member = mysqli_fetch_assoc($result_memebr);
if (isset($_POST['submit'])) {
    $save_path = 'uploads' . date('/Y/m/d/');
    //寫上服務器上文件係統的路徑,而不是url地址
    $upload = upload($save_path, '8M', 'photo');
    if ($upload['return']) {
        $query = "update cfc_member set photo='{$upload['save_path']}' where id={$member_id}";
        execute($link, $query);
        if (mysqli_affected_rows($link) == 1) {
            skip("member.php?id={$member_id}", 'ok', '頭像設置成功!');
        } else {
            skip('member_photo_update.php', 'error', '頭像設置失敗,請重試');
        }
    } else {
        skip('member_photo_update.php', 'error', $upload['error']);
    }
}
//SUB_URL.
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<title></title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<style type="text/css">
body {
	font-size:12px;
	font-family:微軟雅黑;
開發者ID:sakuraliu,項目名稱:bbs,代碼行數:31,代碼來源:member_photo_update.php

示例14: setUp

 public function setUp()
 {
     if (!extension_loaded('pdo')) {
         return skip('pdo extension is required');
     }
     // XXX: check pdo driver
     #          if( ! extension_loaded('pdo_pgsql') )
     #              return skip('pdo pgsql required');
     if ($driverType = $this->getCurrentDriverType()) {
         $this->pdo = $this->createConnection($driverType);
     } else {
         throw new Exception("Please define driver type for testing.");
     }
     if (!$this->pdo) {
         throw new Exception("Can not create PDO connection: " . get_class($this));
     }
     // throw Exception on Error.
     $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
     $this->setupSchema();
     ok($this->pdo);
 }
開發者ID:Ruyka,項目名稱:SQLBuilder,代碼行數:21,代碼來源:PDOQueryTestCase.php

示例15: skip

    skip('index.php', 'ok', '您已經登錄,請不要重複登錄!');
}
if (isset($_POST['submit'])) {
    include_once 'inc/check_login.inc.php';
    $_POST = escape($link, $_POST);
    $query = "select * from cfc_manage where name='{$_POST['name']}' and pw=md5('{$_POST['pw']}')";
    $result = execute($link, $query);
    if (mysqli_num_rows($result) == 1) {
        $data = mysqli_fetch_assoc($result);
        $_SESSION['manage']['name'] = $data['name'];
        $_SESSION['manage']['pw'] = sha1($data['pw']);
        $_SESSION['manage']['id'] = $data['id'];
        $_SESSION['manage']['level'] = $data['level'];
        skip('index.php', 'ok', '登錄成功!');
    } else {
        skip('login.php', 'error', '用戶名或者密碼錯誤,請重試!');
    }
}
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<title>後台登錄</title>
<meta name="keywords" content="後台登錄" />
<meta name="description" content="後台登錄" />
<style type="text/css">
body {
	background:#f7f7f7;
	font-size:14px;
}
開發者ID:sakuraliu,項目名稱:bbs,代碼行數:31,代碼來源:login.php


注:本文中的skip函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。