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


PHP Inspekt::isInt方法代碼示例

本文整理匯總了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;
 }
開發者ID:ekhtsasy,項目名稱:inspekt,代碼行數:18,代碼來源:Cage.php

示例2: testIsInt4

 /**
  * 
  */
 public function testIsInt4()
 {
     $input = 2147483647;
     $this->assertTrue(Inspekt::isInt($input));
 }
開發者ID:vkoser,項目名稱:PlainNoteServer,代碼行數:8,代碼來源:InspektTest.php

示例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>
開發者ID:stephenjschaefer,項目名稱:APlusPhotography,代碼行數:31,代碼來源:search.inc.php

示例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;
 }
開發者ID:funkatron,項目名稱:inspekt,代碼行數:16,代碼來源:Cage.php


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