当前位置: 首页>>代码示例>>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;未经允许,请勿转载。