本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}