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


PHP String::htmlspecialchars方法代碼示例

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


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

示例1: __construct

 public function __construct()
 {
     parent::__construct();
     $this->s_db = Loader::model('poster_space_model');
     $this->db = Loader::model('poster_model');
     $this->M = String::htmlspecialchars(S('common/poster'));
 }
開發者ID:hubs,項目名稱:yuncms,代碼行數:7,代碼來源:PosterController.php

示例2: register

 /**
  * 申請友情鏈接
  */
 public function register()
 {
     if (isset($_POST['dosubmit'])) {
         if ($_POST['name'] == "") {
             showmessage(L('sitename_noempty'), U('link/index/register'));
         }
         if ($_POST['url'] == "") {
             showmessage(L('siteurl_not_empty'), U('link/index/register'));
         }
         if (!in_array($_POST['linktype'], array('0', '1'))) {
             $_POST['linktype'] = '0';
         }
         $link_db = Loader::model('link_model');
         $_POST['logo'] = String::htmlspecialchars($_POST['logo']);
         if ($_POST['linktype'] == '0') {
             $sql = array('typeid' => $_POST['typeid'], 'linktype' => $_POST['linktype'], 'name' => $_POST['name'], 'url' => $_POST['url']);
         } else {
             $sql = array('typeid' => $_POST['typeid'], 'linktype' => $_POST['linktype'], 'name' => $_POST['name'], 'url' => $_POST['url'], 'logo' => $_POST['logo']);
         }
         $link_db->insert($sql);
         showmessage(L('add_success'), U('link/index'));
     } else {
         $setting = S('common/link');
         if (isset($setting['is_post']) && $setting['is_post'] == '0') {
             showmessage(L('suspend_application'), HTTP_REFERER);
         }
         $this->type = Loader::model('type_model');
         $types = $this->type->get_types();
         // 獲取站點下所有友情鏈接分類
         $SEO = seo('', L('application_links'), '', '');
         include template('link', 'register');
     }
 }
開發者ID:hubs,項目名稱:yuncms,代碼行數:36,代碼來源:IndexController.php

示例3: encode

 public function encode($text, $textType = "")
 {
     if (is_object($text)) {
         return $text;
     }
     return String::htmlspecialchars($text);
 }
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:7,代碼來源:xmlconverter.php

示例4: type_lists

 /**
  * 首頁 友情鏈接分類 循環 .
  *
  * @param
  *        	$data
  */
 public function type_lists($data)
 {
     if (!in_array($data['listorder'], array('desc', 'asc'))) {
         $data['listorder'] = 'desc';
     }
     $sql = array('application' => APP);
     $r = $this->type_db->where($sql)->order('listorder ' . $data['listorder'])->limit($data['limit'])->select();
     return String::htmlspecialchars($r);
 }
開發者ID:hubs,項目名稱:yuncms,代碼行數:15,代碼來源:link_tag.php

示例5: encode

 public function encode($text, $textType = "")
 {
     if (is_object($text)) {
         return $text;
     }
     $textType = Converter::initTextType($textType);
     if ($textType == Converter::HTML) {
         return $text;
     }
     return String::htmlspecialchars($text);
 }
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:11,代碼來源:htmlconverter.php

示例6: init

 public function init()
 {
     if (isset($_GET['typeid'])) {
         $where = array('typeid' => intval($_GET['typeid']));
     } else {
         $where = array();
     }
     $page = isset($_GET['page']) && intval($_GET['page']) ? intval($_GET['page']) : 1;
     $infos = $this->db->where($where)->order('listorder DESC,linkid DESC')->listinfo($page, 15);
     $pages = $this->db->pages;
     $types = $this->db2->where(array('application' => APP))->order('typeid DESC')->listinfo();
     $types = String::htmlspecialchars($types);
     $type_arr = array();
     foreach ($types as $typeid => $type) {
         $type_arr[$type['typeid']] = $type['name'];
     }
     $big_menu = big_menu('?app=link&controller=link&action=add', 'add', L('link_add'), 700, 450);
     include $this->view('link_list');
 }
開發者ID:hubs,項目名稱:yuncms,代碼行數:19,代碼來源:LinkController.php

示例7: read_group

 /**
  * 查看係統短消息
  */
 public function read_group()
 {
     if ((!isset($_GET['group_id']) || empty($_GET['group_id'])) && (!isset($_POST['group_id']) || empty($_POST['group_id']))) {
         return false;
     }
     // 查詢消息詳情
     $infos = $this->message_group_db->getby_id($_GET['group_id']);
     $infos = String::htmlspecialchars($infos);
     if (!is_array($infos)) {
         showmessage(L('message_not_exist'), 'blank');
     }
     // 檢查查看表是否有記錄,無則向message_data 插入瀏覽記錄
     $check = $this->message_data_db->where(array('userid' => $this->_userid, 'group_message_id' => $_GET['group_id']))->select();
     if (!$check) {
         $this->message_data_db->insert(array('userid' => $this->_userid, 'group_message_id' => $_GET['group_id']));
     }
     include template('message', 'read_group');
 }
開發者ID:hubs,項目名稱:yuncms,代碼行數:21,代碼來源:IndexController.php

示例8: show_stat

 /**
  * 統計廣告展示次數
  *
  * @param intval $spaceid 廣告版位ID
  * @param intval $id 廣告ID
  * @return boolen
  */
 protected function show_stat($spaceid = 0, $id = 0)
 {
     $M = String::htmlspecialchars(S('common/poster'));
     if ($M['enablehits'] == 0) {
         return true;
     }
     $spaceid = intval($spaceid);
     $id = intval($id);
     if (!$id) {
         return false;
     }
     if (!$spaceid) {
         $r = $this->db->where(array('id' => $id))->field('spaceid')->find();
         $spaceid = $r['spaceid'];
     }
     $ip = IP;
     $ip_area = Loader::lib('lib/lib_ip');
     $area = $ip_area->get($ip);
     $username = cookie('username') ? cookie('username') : '';
     $this->db->where(array('id' => $id))->update(array('hits' => '+1'));
     $this->s_db->insert(array('pid' => $id, 'spaceid' => $spaceid, 'username' => $username, 'area' => $area, 'ip' => $ip, 'referer' => HTTP_REFERER, 'clicktime' => TIME, 'type' => 0));
     return true;
 }
開發者ID:hubs,項目名稱:yuncms,代碼行數:30,代碼來源:IndexController.php


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