本文整理汇总了PHP中Zend_Filter::isInt方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Filter::isInt方法的具体用法?PHP Zend_Filter::isInt怎么用?PHP Zend_Filter::isInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Filter
的用法示例。
在下文中一共展示了Zend_Filter::isInt方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testInt
/**
* Returns value if it is a valid integer value, FALSE otherwise.
*
* @param mixed $key
* @return mixed
*/
public function testInt($key)
{
if (!$this->keyExists($key)) {
return false;
}
if (Zend_Filter::isInt($this->_source[$key])) {
return $this->_source[$key];
}
return FALSE;
}
示例2: testInt
/**
* Returns value if it is a valid integer value, FALSE otherwise.
*
* @param mixed $key
* @return mixed
*/
public function testInt($key)
{
if (Zend_Filter::isInt($this->_source[$key])) {
return $this->_source[$key];
}
return FALSE;
}
示例3: _validateTagSearch
/**
* Validate Tag Search Options
*
* @param array $options
*/
protected function _validateTagSearch($options)
{
$valid_options = array('api_key', 'method', 'user_id', 'per_page', 'page', 'extras', 'min_upload_date', 'min_taken_date', 'max_upload_date', 'max_taken_date', 'tag_mode', 'tags');
if (!is_array($options)) {
return;
}
$this->_compareOptions($options, $valid_options);
if (!Zend_Filter::isBetween($options['per_page'], 1, 500, true)) {
throw new Zend_Service_Exception($options['per_page'] . ' is not valid for the "per_page" option');
}
if (!Zend_Filter::isInt($options['page'])) {
throw new Zend_Service_Exception($options['page'] . ' is not valid for the "page" option');
}
// validate extras, which are delivered in csv format
if ($options['extras']) {
$extras = explode(',', $options['extras']);
$valid_extras = array('license', 'date_upload', 'date_taken', 'owner_name', 'icon_server');
foreach ($extras as $extra) {
/**
* @todo The following does not do anything [yet], so it is commented out.
*/
//in_array(trim($extra), $valid_extras);
}
}
}
示例4: testisInt
/**
* @deprecated since 0.8.0
* @return void
*/
public function testisInt()
{
$this->assertTrue(Zend_Filter::isInt(100), '100 is a valid integer');
$this->assertFalse(Zend_Filter::isInt(1.23), '1.2e3 is not a valid integer');
}
示例5: isInt
/**
* Returns value if it is a valid integer value, FALSE otherwise.
*
* @param mixed $key
* @return mixed
*/
public function isInt($key)
{
return Zend_Filter::isInt($this->_source[$key]);
}
示例6: testInt
/**
* Returns value if it is a valid integer value, FALSE otherwise.
*
* @param mixed $key
* @return mixed
*/
public function testInt($key = null)
{
if (!($value = $this->keyExists($key))) {
return false;
}
if (Zend_Filter::isInt($value)) {
return $value;
}
return FALSE;
}