本文整理匯總了PHP中Inspekt::isInt方法的典型用法代碼示例。如果您正苦於以下問題:PHP Inspekt::isInt方法的具體用法?PHP Inspekt::isInt怎麽用?PHP Inspekt::isInt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Inspekt
的用法示例。
在下文中一共展示了Inspekt::isInt方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testInt
/**
* Returns value if it is a valid integer value, FALSE otherwise.
*
* @param mixed $key
* @return mixed
*
* @tag validator
*/
function testInt($key)
{
if (!$this->keyExists($key)) {
return false;
}
if (Inspekt::isInt($this->_getValue($key))) {
return $this->_getValue($key);
}
return FALSE;
}
示例2: testIsInt4
/**
*
*/
public function testIsInt4()
{
$input = 2147483647;
$this->assertTrue(Inspekt::isInt($input));
}
示例3: foreach
$albcat_terms[] = " LIKE '%{$word}%'";
}
foreach ($search_params['params'] as $param => $value) {
if (in_array($param, $allowed)) {
$fields[] = ($param == 'title' ? 'p.title' : $param) . " LIKE '%{$word}%'";
}
}
$sections[] = count($fields) ? '(' . implode(' OR ', $fields) . ')' : '';
}
}
}
}
$sql .= count($sections) ? '(' . implode($type, $sections) . ')' : '0';
}
$sql .= Inspekt::isInt($USER['search']['params']['newer_than']) ? ' AND ( ctime > ' . time() . ' - ' . $USER['search']['params']['newer_than'] * 60 * 60 * 24 . ')' : '';
$sql .= Inspekt::isInt($USER['search']['params']['older_than']) ? ' AND ( ctime < ' . time() . ' - ' . $USER['search']['params']['older_than'] * 60 * 60 * 24 . ')' : '';
$sql .= " AND approved = 'YES' {$FORBIDDEN_SET}";
if ($superCage->get->keyExists('album_title')) {
$album_query = "SELECT aid, title, description FROM `{$CONFIG['TABLE_ALBUMS']}` AS p" . " WHERE (`title` " . implode(" {$type} `title` ", $albcat_terms) . ") {$FORBIDDEN_SET}";
$result = cpg_db_query($album_query);
if (mysql_num_rows($result) > 0) {
starttable('100%', $lang_meta_album_names['album_search'], 2);
while ($alb = mysql_fetch_assoc($result)) {
$thumb_query = "SELECT filepath, filename, url_prefix, pwidth, pheight " . " FROM `{$CONFIG['TABLE_PICTURES']}` " . " WHERE (`aid` = '{$alb['aid']}') " . " AND approved = 'YES' " . " ORDER BY `pid` DESC";
$thumb_result = cpg_db_query($thumb_query);
$thumb = mysql_fetch_assoc($thumb_result);
// TODO: query above only pulls in last_pid in each album, not correct album thumb as set by user
$thumb_url = get_pic_url($thumb, 'thumb');
$thumb_size = compute_img_size($thumb['pwidth'], $thumb['pheight'], $CONFIG['alb_list_thumb_size'], true, 'cat_thumb');
?>
<tr>
示例4: testInt
/**
* Returns value if it is a valid integer value, FALSE otherwise.
*
* @param mixed $key
* @return mixed
* @throws Exception
* @tag validator
*/
public function testInt($key)
{
$value = $this->getValueOrNull($key);
if (!is_null($value) && Inspekt::isInt($value)) {
return $value;
}
return false;
}