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


PHP s::isArray方法代碼示例

本文整理匯總了PHP中s::isArray方法的典型用法代碼示例。如果您正苦於以下問題:PHP s::isArray方法的具體用法?PHP s::isArray怎麽用?PHP s::isArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在s的用法示例。


在下文中一共展示了s::isArray方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _updateDb

 function _updateDb()
 {
     global $db;
     $fileContent = $this->_getFileContent();
     $temparray = explode("\t", $fileContent);
     $data = s::isArray($temparray) ? array_count_values($temparray) : array();
     $nowtime = PwStrtoTime(get_date($this->_timestamp, 'Y-m-d'));
     $sql = array();
     foreach ($data as $key => $val) {
         $key = trim($this->_filterCheckKeyword($key));
         if (!$key) {
             continue;
         }
         $sql[] = array($key, $val, $nowtime);
         if (++$count > 1000) {
             break;
         }
     }
     if (!$sql) {
         return false;
     }
     $db->query("INSERT INTO pw_searchstatistic(keyword,num,created_time) VALUES " . S::sqlMulti($sql));
     $deleteTime = $this->_timestamp - 86400 * 90;
     $db->query("DELETE FROM pw_searchstatistic WHERE created_time < {$deleteTime}");
     return true;
 }
開發者ID:sherlockhouse,項目名稱:aliyun,代碼行數:26,代碼來源:keywordstatistic.class.php

示例2: getUsersBySchoolidsAndUserIds

 /**
  * 根據教育經曆schoolids和userIds獲取用戶
  * 
  * @param array $companyids
  * @param array $userIds 用戶ids
  * @return array
  */
 function getUsersBySchoolidsAndUserIds($schoolids, $userIds, $num)
 {
     if (!s::isArray($schoolids) || !s::isArray($userIds)) {
         return array();
     }
     $membersDb = $this->_getMembersDB();
     if ($this->countUsersBySchoolidsAndUserIds($schoolids, $userIds) < 1) {
         return array();
     }
     return $membersDb->getUsersByCompanyidAndUserIds($schoolids, $userIds, $num);
 }
開發者ID:jechiy,項目名稱:PHPWind,代碼行數:18,代碼來源:userservice.class.php

示例3: getUsersBySchoolidsAndUserIds

 /**
  * 根據教育經曆companyids和userIds獲取用戶
  * 
  * @param array $companyids
  * @param array $userIds 用戶ids
  * @return array
  */
 function getUsersBySchoolidsAndUserIds($schoolids, $userIds, $num)
 {
     if (!s::isArray($schoolids) || !s::isArray($userIds)) {
         return array();
     }
     $query = $this->_db->query("SELECT m.uid FROM " . $this->_tableName . " m LEFT JOIN " . $this->_memberDataTableName . " md USING(uid) LEFT JOIN " . $this->_userEducation . " me USING(uid) WHERE m.uid IN(" . S::sqlImplode($userIds) . ") AND me.schoolid IN(" . S::sqlImplode($schoolids) . ") " . $this->_Limit(0, $num));
     return $this->_getAllResultFromQuery($query);
 }
開發者ID:sherlockhouse,項目名稱:aliyun,代碼行數:15,代碼來源:membersdb.class.php

示例4: _buildCms

 function _buildCms($cms, $keywords)
 {
     if (!$cms) {
         return array();
     }
     $result = $columnInfo = array();
     $keywords = s::isArray($keywords) ? $keywords : array($keywords);
     $columnDb = $this->_getColumnName($cms);
     foreach ($columnDb as $value) {
         $columnInfo[$value['column_id']] = $value['name'];
     }
     foreach ($cms as $value) {
         $value['article_id'] = $value['article_id'];
         $value['createtime'] = get_date($value['postdate'], "Y-m-d H:i");
         $value['descrip'] = strip_tags($value['descrip']);
         $value['descrip'] = substrs($value['descrip'], 170);
         $value['column_id'] = $value['column_id'];
         $value['column_name'] = $value['column_id'] ? $columnInfo[$value['column_id']] : '末分類';
         $value['postdate'] = get_date($value['postdate'], "Y-m-d H:i");
         foreach ($keywords as $keyword) {
             $keyword && ($value['subject'] = $this->_highlighting($keyword, $value['subject']));
             $keyword && ($value['descrip'] = $this->_highlighting($keyword, $value['descrip']));
         }
         $result[] = $value;
     }
     return $result;
 }
開發者ID:sherlockhouse,項目名稱:aliyun,代碼行數:27,代碼來源:cmssearcher.extend.php

示例5: getSearchAdvert

 /**
  * 獲得搜索廣告
  * 
  */
 function getSearchAdvert($keyword)
 {
     global $timestamp, $s_advertdb, $_time;
     if (!$keyword || !$s_advertdb || !s::isArray($s_advertdb)) {
         return false;
     }
     $hours = $_time['hours'] + 1;
     $result = $advertdb = array();
     foreach ($s_advertdb as $key => $value) {
         if (strpos($value['keyword'], $keyword) === false) {
             continue;
         }
         $advertdb[] = $value;
     }
     foreach ($advertdb as $key => $value) {
         if ($value['starttime'] > $timestamp || $value['endtime'] < $timestamp || $value['dtime'] && strpos(",{$value['dtime']},", ",{$hours},") === false) {
             continue;
         }
         if (!$value['ddate'] && !$value['dweek'] || $value['ddate'] && strpos(",{$value['ddate']},", ",{$_time['day']},") !== false || $value['dweek'] && strpos(",{$value['dweek']},", ",{$_time['week']},") !== false) {
             $result[] = str_replace($keyword, '<em class="s1">' . $keyword . '</em>', $value['code']);
         }
     }
     return $result;
 }
開發者ID:jechiy,項目名稱:PHPWind,代碼行數:28,代碼來源:searcher.php


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