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


PHP pp函數代碼示例

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


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

示例1: logFileBasic

function logFileBasic($logEntry, $rowNumber)
{
    $logEntry = $rowNumber . ' - ' . $logEntry . "\n";
    $fileName = $_SERVER['DOCUMENT_ROOT'] . "/log.txt";
    file_put_contents($fileName, $logEntry, FILE_APPEND | LOCK_EX);
    pp($logEntry);
}
開發者ID:vortexcoaching,項目名稱:MQP_Alchemy__Truth,代碼行數:7,代碼來源:helperfunctions.blade.php

示例2: __construct

 /**
  * censusApp Constructor
  */
 public function __construct()
 {
     $this->registerPostType();
     add_action('add_meta_boxes', array($this, 'add_custom_meta_box'));
     add_action('save_post', array($this, 'save_custom_meta'));
     wp_register_script('wp_quiz_main_js', pp() . '/js/custom-js.js', array('jquery', 'jquery-ui-sortable'), null, true);
     wp_enqueue_script('wp_quiz_main_js');
 }
開發者ID:escobar022,項目名稱:cens_wp,代碼行數:11,代碼來源:censusapp.php

示例3: showAction

 public function showAction()
 {
     $uid = (int) $_GET['uid'];
     $memeber = $this->model('member')->findByPrk($uid);
     pp($memeber);
     $this->model('member')->debug = true;
     $s = $this->model('member')->findField('username', array('uid' => $uid, 'username' => $memeber['username']));
     pp($s);
 }
開發者ID:BGCX067,項目名稱:eyesphp-svn-to-git,代碼行數:9,代碼來源:mainController.class.php

示例4: getFile

function getFile()
{
    //$file = "data/Alchemy_Extract_final.csv";
    $file = "data/2016-02-04-Long_Names.csv";
    //$file = "data/a_testing.csv";
    $sr = serverRoot();
    //pp($sr.$file);
    if (file_exists($sr . $file) == 'true') {
        //pp($sr.$file);
        return $sr . $file;
    } else {
        pp('Source file ' . $sr . $file . ' does not exist');
    }
}
開發者ID:vortexcoaching,項目名稱:MQP_Alchemy__Truth,代碼行數:14,代碼來源:testfunctions2confirmed.blade.php

示例5: pp

function pp($arr)
{
    $retStr = '<ul>';
    if (is_array($arr)) {
        foreach ($arr as $key => $val) {
            if (is_array($val)) {
                $retStr .= '<li>' . $key . ' => ' . pp($val) . '</li>';
            } else {
                $retStr .= '<li>' . $key . ' => ' . $val . '</li>';
            }
        }
    }
    $retStr .= '</ul>';
    return $retStr;
}
開發者ID:BLOODAXED,項目名稱:gw2_thing,代碼行數:15,代碼來源:a.php

示例6: getInstance

 protected function getInstance($record, CsvImportProfile $profile)
 {
     pp('User address import get instance');
     $fields = $profile->getSortedFields();
     if (isset($fields['UserAddress']['ID'])) {
         $instance = ActiveRecordModel::getInstanceByID('UserAddress', $record[$fields['UserAddress']['ID']], true);
     } else {
         if (isset($fields['AddressUser']['ID'])) {
             $owner = User::getInstanceByID($record[$fields['AddressUser']['ID']], true);
         } else {
             if (isset($fields['AddressUser']['email'])) {
                 $owner = User::getInstanceByEmail($record[$fields['AddressUser']['email']]);
             }
         }
     }
     if (isset($owner)) {
         if ($profile->isColumnSet('AddressUser.isShipping')) {
             $type = $this->evalBool(strtolower($record[$profile->getColumnIndex('AddressUser.isShipping')])) ? 'ShippingAddress' : 'BillingAddress';
         } else {
             $type = 'BillingAddress';
         }
         $owner->loadAddresses();
     }
     if (empty($instance)) {
         if (empty($owner)) {
             return;
         }
         $isDefault = $profile->isColumnSet('AddressUser.isDefault') && $this->evalBool(strtolower($record[$profile->getColumnIndex('AddressUser.isDefault')]));
         if ($isDefault) {
             $field = 'default' . $type;
             $addressType = $owner->{$field}->get();
             $instance = $addressType->userAddress->get();
         }
         if (empty($addressType)) {
             $instance = UserAddress::getNewInstance();
             $addressType = call_user_func_array(array($type, 'getNewInstance'), array($owner, $instance));
             if ($isDefault) {
                 $owner->{$field}->set($addressType);
             }
         }
         $addressType->userAddress->set($instance);
         $instance->addressType = $addressType;
     }
     return $instance;
 }
開發者ID:saiber,項目名稱:livecart,代碼行數:45,代碼來源:UserAddressImport.php

示例7: pp

function pp($obj, $indent = 0)
{
    foreach ($obj as $k => $v) {
        $type = gettype($v);
        if (\snow_eq($type, "string") || \snow_eq($type, "integer") || \snow_eq($type, "NULL")) {
            echo sprintf("%s%s: %s\n", str_repeat(" ", $indent * 2), (string) $k, (string) $v);
        } elseif (\snow_eq($type, "boolean")) {
            echo sprintf("%s%s: %s\n", str_repeat(" ", $indent * 2), (string) $k, $v ? "true" : "false");
        } elseif (\snow_eq($type, "object")) {
            echo sprintf("%s%s - %s\n", str_repeat(" ", $indent * 2), $k, get_class($v));
            pp($v, $indent + 1);
        } elseif (\snow_eq($type, "array")) {
            echo sprintf("%s%s - %s\n", str_repeat(" ", $indent * 2), $k, "array");
            pp($v, $indent + 1);
        } else {
            var_dump($type);
            throw new Exception("Type not implemented: " . $type);
        }
    }
    unset($k, $v);
}
開發者ID:runekaagaard,項目名稱:snowscript,代碼行數:21,代碼來源:Visitors.php

示例8: redimensionne_image

		if ( $nom_photo === NULL or !file_exists($photos) ) {
			$photos = "../../mod_trombinoscopes/images/trombivide.jpg";
		}
		$valeur = redimensionne_image($photos);
    ?>
			<img src="<?php echo $photos; ?>" style="width: <?php echo $valeur[0]; ?>px; height: <?php echo $valeur[1]; ?>px; border: 0px" alt="" title="" />
	<?php
    } ?>
		</div>
		<div style="float: left; margin: 12.5px 0px 0px 0px; width: 36%">
			Nom : <strong><?php echo $nom_eleve; ?></strong><br />
			Prénom : <strong><?php echo $prenom_eleve; ?></strong><br />
			Date de naissance : <?php echo $naissance_eleve; ?><br />
			Age : <strong><?php echo age($date_de_naissance); ?> ans</strong><br />
			<br />
			Classe : <a href="#" class="info"><?php echo classe_de($login_eleve); ?><span style="width: 300px;">(Suivi par : <?php echo pp(classe_court_de($login_eleve)); ?>)</span></a>
		</div>
		<div style="float: left; background-image: url(../images/responsable.png); background-repeat:no-repeat; height: 175px; width: 20px; margin-left: 10px;">&nbsp;</div>
		<div style="float: left; margin: 12.5px; overflow: auto;  width: 40%;">
	<?php
		// L'affichage des responsables : le 1 est en rouge et est identifié comme tel
		$cpt_responsable = 0;
		while ( !empty($responsable_eleve[$cpt_responsable]) )
		{
			if ($responsable_eleve[$cpt_responsable]['resp_legal'] == 1) {
				$style = ' style="color: red;"';
				$text = '(resp. 1)';
			}else {
				if ($responsable_eleve[$cpt_responsable]['resp_legal'] == 2) {
					$style='';
					$text = '(resp. 2)';
開發者ID:rhertzog,項目名稱:lcs,代碼行數:31,代碼來源:gestion_absences.php

示例9: strpos_array

 private function strpos_array($haystack, $needles, $offset = 0)
 {
     if (is_array($needles)) {
         pp($needles);
         foreach ($needles as $needle) {
             $pos = $this->strpos_array($haystack, $needle);
             if ($pos !== false) {
                 return $pos;
             }
         }
         return false;
     } else {
         return strpos($haystack, $needles, $offset);
     }
 }
開發者ID:NukaCode,項目名稱:Foundation,代碼行數:15,代碼來源:FormBuilder.php

示例10: pp

		<?php 
}
?>
		
	</div>

	<div id="left">
		<h1><?php 
echo $ex->getMessage();
?>
</h1>
		<?php 
if ($ex->getLine() == 0) {
    ?>
			<div><?php 
    pp($ex->getFile());
    ?>
</div>
		<?php 
} else {
    ?>
			<div>Error on line <?php 
    echo $ex->getLine();
    ?>
 of <?php 
    echo $ex->getFile();
    ?>
</div>
		<?php 
}
?>
開發者ID:jonthornton,項目名稱:JMVC,代碼行數:31,代碼來源:exception_html.php

示例11: ppv

function ppv($v)
{
    ob_start();
    var_dump($v);
    pp(ob_get_clean());
}
開發者ID:NeoCortexBg,項目名稱:zf2-todo,代碼行數:6,代碼來源:debug.php

示例12: isLoggedIn

 /**
  * check if the user has logged
  *
  * @return boolean
  */
 function isLoggedIn()
 {
     pp(111);
     return !empty($_SESSION[$this->__loginIndexInSession]) ? true : false;
 }
開發者ID:saiber,項目名稱:www,代碼行數:10,代碼來源:class.auth.php

示例13: testClass

}
$a = new testClass();
$b = new emptyTestClass();
$res = fopen(__FILE__, 'r');
$val = array('string' => 'string', 'int' => 123, 'float' => 123.3, 'subarray' => array('a' => 'Lorem ipsum dolor sit amet, neptune reddens pater unica suae in fuerat construeret in fuerat accidens inquit merui litore. Opto cum magna aliter refundens domum sum in lucem exempli paupers coniunx in lucem exitum atque bona delata iuvenis. Eo debeas ait regem ut sua confusus eos, viam iube es ego esse ait est in. Musis nihilominus admonendus tu mihi quidditas. Tum vero rex ut diem obiecti ad te finis puellam effari ergo accipiet si. Vituperia ad suis caelo in rei exultant deo hanc! Taliarchum in fuerat est se sed, nuptui tradiditque corpus multis miraculum manibus dimittit in! Nuntiatur quae ait Cumque hoc ait regem consolatus dum veniens Theophilum vinum dolor Jesus Circumdat flante vestibus mundo anima. Lycoridem Apollonio vidit pater beneficiorum universos civitatem auri tecum ad suis ut libertatem accipies. Redde pariter necandum loco in deinde vero rex in modo. Acceptis codicello de his domino nostrud exercitu necessitate sit dolor ad per dicis ubi diu desideriis meo.', 'b' => 'Quattuordecim anulum in modo invenit', 'subsubarray' => array('Lorem ipsum dolor sit amet', 'deducitur potest meum festinus', 'pervenissem filia omnes deo', 'hanc nec caecatus dum animae')), 'false' => FALSE, 'true' => TRUE, 'null' => NULL, 'object' => $a, 'resource' => $res, 'emptyArray' => array(), 'emptyObject' => $b);
?>
<div style="overflow: hidden">
	<div style="width: 50%; float: left;"><h2>pp( $val )</h2><?php 
pp($val);
?>
</div>
	<div style="width: 50%; float: left;"><h2>print_r( $val ) + &lt;pre&gt;</h2><pre><?php 
print_r($val);
?>
</pre></div>
</div>
<h2 id="autoCollapsed">Folded array</h2>
<?php 
pp($val, TRUE);
?>
<h2 id="autoOpened">Array unfolded to keys "c" and "subarray"</h2>
<?php 
pp($val, array('autoOpen' => array('c', 'subarray')));
?>
<h2 id="autoOpened2">Array unfolded to key "c"</h2>
<?php 
pp($val, 'c');
fclose($res);
?>
</body>
</html>
開發者ID:alexxxnf,項目名稱:nf_pp,代碼行數:31,代碼來源:demo.php

示例14: function

<?php

require 'pp.php';
$fib = function ($n) use(&$fib) {
    switch ($n) {
        case 0:
            return 0;
        case 1:
            return 1;
        default:
            return $fib($n - 1) + $fib($n - 2);
    }
};
pp('fib', $fib(7));
$calls = 0;
$counted = function ($f) {
    return function ($f) use($f) {
        global $calls;
        $args = func_get_args();
        $calls++;
        return $f($args[0]);
    };
};
$fib = $counted($fib);
//$calls = 0;
//printf("%d called 'fib' %d times\n", $fib(30), $calls);
//$calls = 0;
//printf("%d called 'fib' %d times\n", $fib(31), $calls);
$memoize = function ($f, $normalize = null) {
    $results = array();
    if (!$normalize) {
開發者ID:kiltec,項目名稱:higherorder-php,代碼行數:31,代碼來源:4-fib.php

示例15: pd

/**
 * Dump the contents of a variable and exit(). Similar to pp()
 * @param mixed $data
 * @return void
 */
function pd($data)
{
    if (!IS_PRODUCTION) {
        pp($data);
        die;
    }
}
開發者ID:jonthornton,項目名稱:JMVC,代碼行數:12,代碼來源:init.php


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