本文整理匯總了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);
}
示例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');
}
示例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);
}
示例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');
}
}
示例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;
}
示例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;
}
示例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);
}
示例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;"> </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)';
示例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);
}
}
示例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
}
?>
示例11: ppv
function ppv($v)
{
ob_start();
var_dump($v);
pp(ob_get_clean());
}
示例12: isLoggedIn
/**
* check if the user has logged
*
* @return boolean
*/
function isLoggedIn()
{
pp(111);
return !empty($_SESSION[$this->__loginIndexInSession]) ? true : false;
}
示例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 ) + <pre></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>
示例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) {
示例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;
}
}