本文整理匯總了PHP中XString::fixHtmlText方法的典型用法代碼示例。如果您正苦於以下問題:PHP XString::fixHtmlText方法的具體用法?PHP XString::fixHtmlText怎麽用?PHP XString::fixHtmlText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類XString
的用法示例。
在下文中一共展示了XString::fixHtmlText方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getInboxMsgListByUserId
/**
* @brief 根據用戶id獲取站內信列表
* @author whd
* @exampleUrl http://dev.mobile-api.haodf.com/patientapi/message_getinboxmsglistbyuserid?userId=613876396&type=all&pageId=1&pageSize=10&xdoc=1
*
* @Param $userId 用戶id
* @Param $type (all,unread)
* @Param $pageId 當前頁碼
* @Param $pageSize 每頁顯示數
*
* @Returns array('id', 'title', 'isread', 'senderName', 'content', 'ctime')
*/
public function getInboxMsgListByUserId($userId, $type, $pageId, $pageSize)
{/*{{{*/
$user = DAL::get()->find('user', $userId);
if ($user->isNull())
{
$this->setErrorCode(107);
return 0;
}
$this->_initPageInfo($pageId, $pageSize);
$options = array();
$options['filterSourceType'] = Message::TYPE_PATIENTCLUB;
if ($type == 'unread')
{
$options['isread'] = 0;
}
if ($type == 'orderbyunread')
{
$options['orderby'] = 'isread';
}
$res = StationLetterClient::getInstance()->getMsgs($userId, Box::TYPE_INBOX, $pageId, $pageSize, $options);
$mailList = $res['msgInfos'];
$infos = array();
$senderIds = array();
foreach ($mailList as $mail)
{
if(empty($mail))
continue;
$info = array();
$info['id'] = $mail['id'];//boxmsgref->id
$info['title'] = strip_tags($mail['title']);
$info['isread'] = $mail['isread'];//狀態
$info['senderName'] = $mail['senderId'];
$info['content'] = mb_substr(trim(XString::fixHtmlText(str_replace(' ', '', $mail['content']))), 0, 15, 'GBK');
$info['ctime'] = strtotime($mail['ctime']);
$infos[] = $info;
$senderIds[] = $mail['senderId'];
}
$userList = DAL::get()->find('User', $senderIds);
foreach($infos as $key => $info)
{
if ($userList[$info['senderName']]->isNull())
$infos[$key]['senderName'] = '身份不明';
else
$infos[$key]['senderName'] = $userList[$info['senderName']]->name;
}
$this->pageInfo = $res['pageInfo'];
$this->content = $infos;
}/*}}}*/