本文整理汇总了PHP中isBlank函数的典型用法代码示例。如果您正苦于以下问题:PHP isBlank函数的具体用法?PHP isBlank怎么用?PHP isBlank使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isBlank函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Pubnub
/**
* Pubnub
*
* Init the Pubnub Client API
*
* @param string $publish_key required key to send messages.
* @param string $subscribe_key required key to receive messages.
* @param string $secret_key optional key to sign messages.
* @param string $origin optional setting for cloud origin.
* @param boolean $ssl required for 2048 bit encrypted messages.
*/
function Pubnub($publish_key = 'demo', $subscribe_key = 'demo', $secret_key = false, $cipher_key = false, $ssl = false, $origin = false, $pem_path = false)
{
$this->SESSION_UUID = $this->uuid();
$this->PUBLISH_KEY = $publish_key;
$this->SUBSCRIBE_KEY = $subscribe_key;
$this->SECRET_KEY = $secret_key;
if (!isBlank($cipher_key)) {
$this->CIPHER_KEY = $cipher_key;
}
$this->SSL = $ssl;
if ($pem_path != false) {
$this->PEM_PATH = $pem_path;
}
if ($origin) {
$this->ORIGIN = $origin;
}
if ($this->ORIGIN == "PHP.pubnub.com") {
trigger_error("Before running in production, please contact support@pubnub.com for your custom origin.\nPlease set the origin from PHP.pubnub.com to IUNDERSTAND.pubnub.com to remove this warning.\n", E_USER_NOTICE);
}
if ($ssl) {
$this->ORIGIN = 'https://' . $this->ORIGIN;
} else {
$this->ORIGIN = 'http://' . $this->ORIGIN;
}
}
示例2: booklistQueryGet
/**
* Creates and returns a query that fetches the book-variables
* @return QueryBuilder A Doctrine-Query-Builder
*/
protected function booklistQueryGet()
{
$query = $this->_em->createQueryBuilder()->select(array('b, s'))->from('Babesk\\ORM\\SchbasBook', 'b')->leftJoin('b.subject', 's');
if (isset($_POST['filterFor']) && !isBlank($_POST['filterFor'])) {
$query->where('b.title LIKE :filterVar')->orWhere('b.author LIKE :filterVar')->orWhere('b.class LIKE :filterVar')->orWhere('b.bundle LIKE :filterVar')->orWhere('b.price LIKE :filterVar')->orWhere('b.isbn LIKE :filterVar')->orWhere('b.publisher LIKE :filterVar')->orWhere('s.name LIKE :filterVar')->orWhere('s.abbreviation LIKE :filterVar')->setParameter('filterVar', '%' . $_POST['filterFor'] . '%');
}
$query->setFirstResult($_POST['pagenumber'] * $_POST['booksPerPage'])->setMaxResults($_POST['booksPerPage']);
return $query;
}
示例3: execute
protected function execute($data)
{
if (isset($data['foreign_languages']) && !isBlank($data['foreign_languages'])) {
$this->languageApply(implode('|', $data['foreign_languages']), $data['_multiselectionSelectedOfUsers']);
} else {
$this->dieError('Keine Daten bekommen!');
}
$this->dieSuccess('Die Fremdsprachen wurden erfolgreich verändert.');
}
示例4: execute
protected function execute($data)
{
if (isset($data['courses']) && !isBlank($data['courses'])) {
$this->coursesApply(implode('|', $data['courses']), $data['_multiselectionSelectedOfUsers']);
} else {
$this->dieError('Keine Daten bekommen');
}
$this->dieSuccess('Die Kurse wurden erfolgreich verändert.');
}
示例5: _moduleContent
function _moduleContent(&$smarty, $module_name)
{
//include module files
include_once "modules/{$module_name}/configs/default.conf.php";
$lang = get_language();
$base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
$lang_file = "modules/{$module_name}/lang/{$lang}.lang";
if (file_exists("{$base_dir}/{$lang_file}")) {
include_once "{$lang_file}";
} else {
include_once "modules/{$module_name}/lang/en.lang";
}
//global variables
global $arrConf;
global $arrConfModule;
global $arrLang;
global $arrLangModule;
$arrConf = array_merge($arrConf, $arrConfModule);
$arrLang = array_merge($arrLang, $arrLangModule);
//folder path for custom templates
$base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
$templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes';
$local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme'];
$formCampos = array();
$txtCommand = isset($_POST['txtCommand']) ? $_POST['txtCommand'] : '';
$oForm = new paloForm($smarty, $formCampos);
$smarty->assign("asterisk", "Asterisk CLI");
$smarty->assign("command", $arrLang["Command"]);
$smarty->assign("txtCommand", htmlspecialchars($txtCommand));
$smarty->assign("execute", $arrLang["Execute"]);
$smarty->assign("icon", "modules/{$module_name}/images/pbx_tools_asterisk_cli.png");
$result = "";
if (!isBlank($txtCommand)) {
$result = "<pre>";
putenv("TERM=vt100");
putenv("PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin");
putenv("SCRIPT_FILENAME=" . strtok(stripslashes($txtCommand), " "));
/* PHP scripts */
$badchars = array("'", "`", "\\", ";", "\"");
// Strip off any nasty chars.
$fixedcmd = str_replace($badchars, "", $txtCommand);
$ph = popen(stripslashes("asterisk -nrx \"{$fixedcmd}\""), "r");
while ($line = fgets($ph)) {
$result .= htmlspecialchars($line);
}
pclose($ph);
$result .= "</pre>";
}
if ($result == "") {
$result = " ";
}
$smarty->assign("RESPUESTA_SHELL", $result);
$contenidoModulo = $oForm->fetchForm("{$local_templates_dir}/new.tpl", $arrLang["Asterisk-Cli"], $_POST);
return $contenidoModulo;
}
示例6: execute
public function execute($dataContainer)
{
parent::entryPoint($dataContainer);
if (isset($_POST['areSelectionsEnabled']) && !isBlank($_POST['areSelectionsEnabled'])) {
$areSelEnabled = $_POST['areSelectionsEnabled'] == 'true';
$this->setSelectionsEnabled($areSelEnabled);
} else {
http_response_code(400);
$this->_logger->log('Correct data not send by client.', 'Notice', Null, json_encode(array('postData' => $_POST)));
}
}
示例7: execute
public function execute($dataContainer)
{
$this->entryPoint($dataContainer);
if (isset($_POST['joinId']) && !isBlank($_POST['joinId'])) {
if ($this->joinDelete($_POST['joinId'])) {
$this->_interface->dieAjax('success', 'Der Benutzer wurde erfolgreich vom Kurs abgemeldet.');
} else {
$this->_interface->dieAjax('error', 'Konnte den Benutzer nicht vom Kurs abmelden.');
}
} else {
$this->_interface->dieAjax('error', 'Keine join-Id gegeben');
}
}
示例8: inputParse
/**
* Parses some input so it can be uploaded to the Db
*/
protected function inputParse()
{
if (!isset($_POST['pricegroupId']) || isBlank($_POST['pricegroupId'])) {
$_POST['pricegroupId'] = 0;
}
$_POST['isSoli'] = isset($_POST['isSoli']) && $_POST['isSoli'] == 'true' ? 1 : 0;
$_POST['accountLocked'] = $_POST['accountLocked'] == 'true' ? 1 : 0;
if (isset($_POST['credits'])) {
$_POST['credits'] = str_replace(',', '.', $_POST['credits']);
} else {
$_POST['credits'] = 0;
}
}
示例9: fnStripSLD
function fnStripSLD($strInput)
{
// returns the sld by stripping off the tld and the dot
// expects a non blank/empty string as input
if (isBlank($strInput)) {
$Sld = "";
} else {
$Tld = strrchr($strInput, ".");
if ($Tld == false) {
$Sld = $strInput;
} else {
$Sld = substr($strInput, 0, strlen($strInput) - strlen($Tld));
}
}
return $Sld;
}
示例10: ArrowPush
/**
* ArrowPush
*
* Init the ArrowPush Client API
*
* @param string $publish_key required key to send messages.
* @param string $subscribe_key required key to receive messages.
* @param string $secret_key optional key to sign messages.
* @param string $origin optional setting for cloud origin.
* @param boolean $ssl required for 2048 bit encrypted messages.
*/
function ArrowPush($publish_key = 'demo', $subscribe_key = 'demo', $secret_key = false, $cipher_key = false, $ssl = false, $origin = false)
{
$this->SESSION_UUID = $this->uuid();
$this->PUBLISH_KEY = $publish_key;
$this->SUBSCRIBE_KEY = $subscribe_key;
$this->SECRET_KEY = $secret_key;
if (!isBlank($cipher_key)) {
$this->CIPHER_KEY = $cipher_key;
}
$this->SSL = $ssl;
if ($origin) {
$this->ORIGIN = $origin;
}
if ($ssl) {
$this->ORIGIN = 'https://' . $this->ORIGIN;
} else {
$this->ORIGIN = 'http://' . $this->ORIGIN;
}
}
示例11: gettext
<div class="content">
<input name="ulfile" type="file" class="btn btn-default btn-sm btn-file" id="ulfile" />
<br />
<button name="submit" type="submit" class="btn btn-primary btn-sm" id="upload" value="UPLOAD">
<i class="fa fa-upload icon-embed-btn"></i>
<?php
echo gettext("Upload");
?>
</button>
</div>
</div>
</div>
<?php
// Experimental version. Writes the user's php code to a file and executes it via a new instance of PHP
// This is intended to prevent bad code from breaking the GUI
if ($_POST['submit'] == "EXECPHP" && !isBlank($_POST['txtPHPCommand'])) {
puts("<div class=\"panel panel-success responsive\"><div class=\"panel-heading\"><h2 class=\"panel-title\">PHP Response</h2></div>");
$tmpname = tempnam("/tmp", "");
$phpfile = fopen($tmpname, "w");
fwrite($phpfile, "<?php\n");
fwrite($phpfile, "require_once(\"/etc/inc/config.inc\");\n");
fwrite($phpfile, "require_once(\"/etc/inc/functions.inc\");\n\n");
fwrite($phpfile, $_POST['txtPHPCommand'] . "\n");
fwrite($phpfile, "?>\n");
fclose($phpfile);
$output = array();
exec("/usr/local/bin/php " . $tmpname, $output);
unlink($tmpname);
$output = implode("\n", $output);
print "<pre>" . htmlspecialchars($output) . "</pre>";
// echo eval($_POST['txtPHPCommand']);
示例12: filterForQuery
protected function filterForQuery($columns, $value)
{
if (!empty($columns) && !isBlank($value)) {
$searches = array();
$query = '';
foreach ($columns as $col) {
if (in_array($col, $this->_filterForColumns)) {
$searches[] = "{$col} LIKE '%{$value}%'";
}
}
if (!empty($searches)) {
$query = 'HAVING ' . implode(' OR ', $searches);
} else {
$query = '';
}
return $query;
} else {
return '';
}
}
示例13: setOnBlank
/**
* If value with the $key in array $container is blank, set it to $toSet
* @param array $container The array which (maybe) contains an element with
* the key $key
* @param mixed $key The key of the value to check for blank-ness
* @param mixed $toSet The value to set when the original value is blank
*/
public static function setOnBlank(array &$container, $key, $toSet)
{
if (empty($container[$key]) || isBlank($container[$key])) {
$container[$key] = $toSet;
}
}
示例14: dbConn
<?php
include "lib.php";
$connect = dbConn();
// 관리자가 1명이상 있을경우 바로 로그인 페이지로...
$temp = mysql_fetch_array(mysql_query("select count(*) from {$member_table} where is_admin='1'", $connect));
if ($temp[0]) {
header("location:admin.php");
mysql_close($connect);
exit;
}
// 빈문자열인지를 검사
if (isBlank($user_id)) {
Error("아이디를 입력하셔야 합니다", "");
}
if (isBlank($password1)) {
Error("비밀번호를 입력하셔야 합니다", "");
}
if (isBlank($password2)) {
Error("비밀번호 확인을 입력하셔야 합니다", "");
}
if ($password1 != $password2) {
Error("비밀번호와 비밀번호 확인이 일치하지 않습니다", "");
}
if (isBlank($name)) {
Error("이름을 입력하셔야 합니다", "");
}
// 관리자 정보 입력
@mysql_query("insert into {$member_table} (user_id,password,name,is_admin,reg_date,level) values ('{$user_id}',password('{$password1}'),'{$name}','1','" . time() . "','1')", $connect) or Error(mysql_error(), "");
mysql_close($connect);
header("location:admin.php");
示例15: generateReconocimientos
$reconocimientos = generateReconocimientos();
//RECID
if (!isset($recid)) {
$recid = generateRandomString(6);
}
//RECDIR
$recdir = getRecdir($recid);
$recurl = "{$SITEURL}/" . preg_replace("/^\\/.+\\/data/", "data", $recdir);
//INPUT FILE
if (isset($recfile)) {
$inprecfile = "<input type='hidden' name='recfile' value='{$recfile}'><input type='hidden' name='recid' value='{$recid}'>";
} else {
$inprecfile = "";
}
if (isset($status)) {
if (!isBlank($status)) {
$rstatus = $RECONSTATUS["{$status}"];
} else {
$status = 3;
$rstatus = "Nuevo";
}
} else {
$status = 3;
$rstatus = "Nuevo";
}
//FORM
$buttons .= <<<B
<tr class="boton">
<td colspan=2>
t<input class="level3" type="submit" name="action" value="Revisado">
t<input class="level3" type="submit" name="action" value="Aprobado">