> 백엔드 개발 > PHP 튜토리얼 > php对表单内容开展处理

php对表单内容开展处理

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
풀어 주다: 2016-06-13 12:01:59
원래의
852명이 탐색했습니다.

php对表单内容进行处理

/**	 * 过滤HTML内容后返回	 *	 * @param      $string	 * @param bool $html	 *	 * @return array|string	 */	public static function safeOutput($string, $html = false) {		if (!$html)			$string = strip_tags($string);		return @Tools::htmlentitiesUTF8($string, ENT_QUOTES);	}	public static function htmlentitiesUTF8($string, $type = ENT_QUOTES) {		if (is_array($string))			return array_map(array('Tools', 'htmlentitiesUTF8'), $string);		return htmlentities((string)$string, $type, 'utf-8');	}	public static function htmlentitiesDecodeUTF8($string) {		if (is_array($string))			return array_map(array('Tools', 'htmlentitiesDecodeUTF8'), $string);		return html_entity_decode((string)$string, ENT_QUOTES, 'utf-8');	}	/**	 * 对POST内容进行处理	 *	 * @return array	 */	public static function safePostVars() {		if (!is_array($_POST))			return array();		$_POST = array_map(array('Tools', 'htmlentitiesUTF8'), $_POST);	}
로그인 후 복사

관련 라벨:
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿