当前位置: 首页>>代码示例>>PHP>>正文


PHP new_html_special_chars函数代码示例

本文整理汇总了PHP中new_html_special_chars函数的典型用法代码示例。如果您正苦于以下问题:PHP new_html_special_chars函数的具体用法?PHP new_html_special_chars怎么用?PHP new_html_special_chars使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了new_html_special_chars函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

	public function __construct() {
		parent::__construct();
		$this->tablename = '';
		$setting = new_html_special_chars(getcache('formguide', 'commons'));
		$this->M = $setting[$this->get_siteid()];
		$this->db = pc_base::load_model('sitemodel_model');
	}
开发者ID:panhongsheng,项目名称:zl_cms,代码行数:7,代码来源:formguide.php

示例2: __construct

 function __construct()
 {
     parent::__construct();
     $setting = new_html_special_chars(getcache('poster', 'commons'));
     $this->M = $setting[$this->get_siteid()];
     $this->db = pc_base::load_model('poster_space_model');
 }
开发者ID:klj123wan,项目名称:czsz,代码行数:7,代码来源:space.php

示例3: register

	 /**
	 *	申请友情链接 
	 */
	public function register() { 
 		$siteid = SITEID;
 		if(isset($_POST['dosubmit'])){
 			if($_POST['name']==""){
 				showmessage(L('sitename_noempty'),"?m=link&c=index&a=register&siteid=$siteid");
 			}
 			if($_POST['url']==""){
 				showmessage(L('siteurl_not_empty'),"?m=link&c=index&a=register&siteid=$siteid");
 			}
 			if(!in_array($_POST['linktype'],array('0','1'))){
 				$_POST['linktype'] = '0';
 			}
 			$link_db = pc_base::load_model(link_model);
 			$_POST['logo'] =new_html_special_chars($_POST['logo']);
 			
 			if($_POST['linktype']=='0'){
 				$sql = array('siteid'=>$siteid,'typeid'=>$_POST['typeid'],'linktype'=>$_POST['linktype'],'name'=>$_POST['name'],'url'=>$_POST['url']);
 			}else{
 				$sql = array('siteid'=>$siteid,'typeid'=>$_POST['typeid'],'linktype'=>$_POST['linktype'],'name'=>$_POST['name'],'url'=>$_POST['url'],'logo'=>$_POST['logo']);
 			}
 			$link_db->insert($sql);
 			showmessage(L('add_success'), "?m=link&c=index&siteid=$siteid");
 		} else {
  			$setting = getcache('link', 'commons');
			$setting = $setting[$siteid];
 			if($setting['is_post']=='0'){
 				showmessage(L('suspend_application'), HTTP_REFERER);
 			}
 			$this->type = pc_base::load_model('type_model');
 			$types = $this->type->get_types($siteid);//获取站点下所有友情链接分类
 			pc_base::load_sys_class('form', '', 0);
  			$SEO = seo(SITEID, '', L('application_links'), '', '');
   			include template('link', 'register');
 		}
	} 
开发者ID:hxzyzz,项目名称:ddc,代码行数:38,代码来源:index.php

示例4: new_html_special_chars

/**
 * 返回经htmlspecialchars处理过的字符串或数组
 * @param $obj 需要处理的字符串或数组
 * @return mixed
 */
function new_html_special_chars($string) {
	$encoding = 'utf-8';
	if(strtolower(CHARSET)=='gbk') $encoding = 'ISO-8859-15';
	if(!is_array($string)) return htmlspecialchars($string,ENT_QUOTES,$encoding);
	foreach($string as $key => $val) $string[$key] = new_html_special_chars($val);
	return $string;
}
开发者ID:panhongsheng,项目名称:zl_cms,代码行数:12,代码来源:global.func.php

示例5: get

 function get($data = array())
 {
     $_groupid = param::get_cookie('_groupid');
     $this->data = $data;
     if (isset($data['id'])) {
         $this->id = $data['id'];
     }
     $info = array();
     $info = array();
     if (is_array($this->fields)) {
         foreach ($this->fields as $field => $v) {
             $func = $v['formtype'];
             $value = isset($data[$field]) ? new_html_special_chars($data[$field]) : '';
             if ($func == 'pages' && isset($data['maxcharperpage'])) {
                 $value = $data['paginationtype'] . '|' . $data['maxcharperpage'];
             }
             if (!method_exists($this, $func)) {
                 continue;
             }
             $form = $this->{$func}($field, $value, $v);
             if ($form !== false) {
                 $star = $v['minlength'] || $v['pattern'] ? 1 : 0;
                 $info[$field] = array('name' => $v['name'], 'tips' => $v['tips'], 'form' => $form, 'star' => $star, 'isomnipotent' => $v['isomnipotent'], 'formtype' => $v['formtype']);
             }
         }
     }
     return $info;
 }
开发者ID:codercpf,项目名称:privatewk,代码行数:28,代码来源:formguide_form.class.php

示例6: get

 function get($data = array())
 {
     $_roleid = param::get_cookie('_roleid');
     $_groupid = param::get_cookie('_groupid');
     $this->data = $data;
     if (isset($data['id'])) {
         $this->id = $data['id'];
     }
     $info = array();
     foreach ($this->fields as $field => $v) {
         if (defined('IN_ADMIN')) {
             if ($v['disabled'] || $v['iscore'] || check_in($_roleid, $v['unsetroleids']) || check_in($_groupid, $v['unsetgroupids'])) {
                 continue;
             }
         } else {
             if ($v['disabled'] || $v['iscore'] || !$v['isadd'] || check_in($_roleid, $v['unsetroleids']) || check_in($_groupid, $v['unsetgroupids'])) {
                 continue;
             }
         }
         $func = $v['formtype'];
         $value = isset($data[$field]) ? new_html_special_chars($data[$field]) : '';
         if ($func == 'pages' && isset($data['maxcharperpage'])) {
             $value = $data['paginationtype'] . '|' . $data['maxcharperpage'];
         }
         if (!method_exists($this, $func)) {
             continue;
         }
         $form = $this->{$func}($field, $value, $v);
         if ($form !== false) {
             $star = $v['minlength'] || $v['pattern'] ? 1 : 0;
             $info[$field] = array('name' => $v['name'], 'tips' => $v['tips'], 'form' => $form, 'star' => $star, 'isbase' => $v['isbase'], 'isomnipotent' => $v['isomnipotent'], 'formtype' => $v['formtype']);
         }
     }
     return $info;
 }
开发者ID:klj123wan,项目名称:czsz,代码行数:35,代码来源:member_form.class.php

示例7: __construct

 function __construct()
 {
     parent::__construct();
     $this->M = new_html_special_chars(getcache('vote', 'commons'));
     $this->db = pc_base::load_model('vote_subject_model');
     $this->db2 = pc_base::load_model('vote_option_model');
 }
开发者ID:pondyond,项目名称:phpcmsv9,代码行数:7,代码来源:vote.php

示例8: xml_serialize

	/**
	 * serialize
	 * @param $data 数组
	 * @return string
	 */
	public function xml_serialize(&$data, $level = 0, $prior_key = NULL) {
		if($level == 0) {
			ob_start();
			echo "<?xml version=\"1.0\" encoding=\"".CHARSET."\"?>\n<root>","\n";
		}
		while(list($key, $value) = each($data)) {
			if(!strpos($key, ' attr')) {
				if(is_array($value) and array_key_exists(0, $value)) {
					$this->xml_serialize($value, $level, $key);    
				} else {
					$tag = $prior_key ? $prior_key : (is_numeric($key) ? 'item' : $key);
					echo str_repeat("\t", $level),'<',$tag;
					if(array_key_exists("$key attr", $data)) {
						while(list($attr_name, $attr_value) = each($data["$key attr"])) {
							echo ' ',$attr_name,'="',new_html_special_chars($attr_value),'"';
						}
						reset($data["$key attr"]);   
					}
					if(is_null($value)) {
						echo " />\n";
					} elseif(!is_array($value)) {
						echo '>',new_html_special_chars($value),"</$tag>\n";
					} else {
						echo ">\n",$this->xml_serialize($value, $level+1),str_repeat("\t", $level),"</$tag>\n";
					}
				}
			}
		}
		reset($data);   
		if($level == 0) {
			$str = &ob_get_contents();
			ob_end_clean();
			return $str.'</root>';
		}
	}
开发者ID:panhongsheng,项目名称:zl_cms,代码行数:40,代码来源:xml.class.php

示例9: __construct

 public function __construct()
 {
     $this->urlrules = getcache('urlrules', 'commons');
     $this->M = new_html_special_chars(getcache('ask', 'commons'));
     self::set_siteid();
     $this->categorys = getcache('category_ask_' . $this->siteid, 'commons');
     $this->html_root = pc_base::load_config('system', 'html_root');
 }
开发者ID:zhouzhouxs,项目名称:Progect,代码行数:8,代码来源:ask_url.class.php

示例10: type_lists

	/**
	 * 首页  友情链接分类 循环 .
	 * @param  $data
	 */
	public function type_lists($data) {
			if (!in_array($data['listorder'], array('desc', 'asc'))) {
					$data ['listorder'] = 'desc';
				}
 			$sql = array('module'=>ROUTE_M,'siteid'=>$data['siteid']);
 			$r = $this->type_db->select($sql, '*', $data['limit'], 'listorder '.$data['listorder']);
			return new_html_special_chars($r);
	}
开发者ID:panhongsheng,项目名称:zl_cms,代码行数:12,代码来源:link_tag.class.php

示例11: __construct

 function __construct()
 {
     $this->db = pc_base::load_model('sitemodel_model');
     $this->m_db = pc_base::load_model('sitemodel_field_model');
     $this->M = new_html_special_chars(getcache('formguide', 'commons'));
     $this->siteid = intval($_GET[siteid]);
     $this->M = $this->M[$this->siteid];
 }
开发者ID:baowzh,项目名称:fulianweb,代码行数:8,代码来源:index.php

示例12: __construct

 function __construct()
 {
     //parent::__construct();
     $this->M = new_html_special_chars(getcache('ask', 'commons'));
     $this->db = pc_base::load_model('ask_model');
     $this->db2 = pc_base::load_model('ask_posts_model');
     $this->db3 = pc_base::load_model('category_model');
     $this->siteid = get_siteid();
 }
开发者ID:zhouzhouxs,项目名称:Progect,代码行数:9,代码来源:load.php

示例13: new_html_special_chars

/**
 * 返回经htmlspecialchars处理过的字符串或数组
 * @param $obj 需要处理的字符串或数组
 * @return mixed
 */
function new_html_special_chars($string)
{
    if (!is_array($string)) {
        return htmlspecialchars($string);
    }
    foreach ($string as $key => $val) {
        $string[$key] = new_html_special_chars($val);
    }
    return $string;
}
开发者ID:baowzh,项目名称:renfang,代码行数:15,代码来源:global.func.php

示例14: __construct

 function __construct()
 {
     parent::__construct();
     $this->M = new_html_special_chars(getcache('ask', 'commons'));
     $this->db = pc_base::load_model('ask_model');
     $this->db2 = pc_base::load_model('answer_model');
     $this->db3 = pc_base::load_model('category_model');
     $this->db_m = pc_base::load_model('member_model');
     $this->siteid = $this->get_siteid();
     $this->categorys = getcache('category_ask_' . $this->siteid, 'commons');
 }
开发者ID:zhouzhouxs,项目名称:Progect,代码行数:11,代码来源:answer.php

示例15: init

 public function init()
 {
     $allow_visitor = new_html_special_chars($_GET['allow_visitor']);
     $auth = sys_auth($allow_visitor, 'DECODE');
     if (strpos($auth, '|') === false) {
         showmessage(L('illegal_operation'));
     }
     $auth_str = explode('|', $auth);
     $flag = $auth_str[0];
     if (!preg_match('/^([0-9]+)|([0-9]+)/', $flag)) {
         showmessage(L('illegal_operation'));
     }
     $readpoint = intval($auth_str[1]);
     $paytype = intval($auth_str[2]);
     $http_referer = urldecode($_GET['http_referer']);
     if (!$readpoint) {
         showmessage(L('illegal_operation'));
     }
     pc_base::load_app_class('spend', 'pay', 0);
     $flag_arr = explode('_', $flag);
     $catid = $flag_arr[0];
     $siteids = getcache('category_content', 'commons');
     $siteid = $siteids[$catid];
     $CATEGORYS = getcache('category_content_' . $siteid, 'commons');
     if (isset($CATEGORYS[$catid])) {
         $setting = string2array($CATEGORYS[$catid]['setting']);
         $repeatchargedays = intval($setting['repeatchargedays']);
         if ($repeatchargedays) {
             $fromtime = SYS_TIME - 86400 * $repeatchargedays;
             $r = spend::spend_time($this->userid, $fromtime, $flag);
             if ($r) {
                 showmessage(L('have_pay'), $http_referer, 1000);
             }
         }
     }
     if ($paytype) {
         if (spend::amount($readpoint, L('msg_readpoint'), $this->userid, $this->username, '', '', $flag) == false) {
             $msg = spend::get_msg();
             $http_referer = APP_PATH . 'index.php?m=pay&c=deposit&a=pay';
         } else {
             $msg = L('readpoint_pay', array('readpoint' => $readpoint));
         }
     } else {
         if (spend::point($readpoint, L('msg_readpoint'), $this->userid, $this->username, '', '', $flag) == false) {
             $msg = spend::get_msg();
             $http_referer = APP_PATH . 'index.php?m=pay&c=deposit&a=pay';
         } else {
             $msg = L('readpoint_pay_point', array('readpoint' => $readpoint));
         }
     }
     showmessage($msg, $http_referer, 3000);
 }
开发者ID:ahmatjan,项目名称:huluphp,代码行数:52,代码来源:readpoint.php


注:本文中的new_html_special_chars函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。