本文整理匯總了PHP中PMF_String::getEncoding方法的典型用法代碼示例。如果您正苦於以下問題:PHP PMF_String::getEncoding方法的具體用法?PHP PMF_String::getEncoding怎麽用?PHP PMF_String::getEncoding使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PMF_String
的用法示例。
在下文中一共展示了PMF_String::getEncoding方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: htmlspecialchars
/**
* Convert special chars to html entities
*
* @param string $str
* @param int $quote_stype
* @param string $charset
* @param boolean $double_encode
*
* @return string
*/
public static function htmlspecialchars($str, $quote_style = ENT_COMPAT, $charset = null, $double_encode = false)
{
if (version_compare(PHP_VERSION, '5.2.3', '>=')) {
return htmlspecialchars($str, $quote_style, null == $charset ? self::$instance->getEncoding() : $charset, $double_encode);
} else {
return htmlspecialchars($str, $quote_style, null == $charset ? self::$instance->getEncoding() : $charset);
}
}
示例2: htmlspecialchars
/**
* Convert special chars to html entities
* @param string $str
* @param int $quote_stype
* @param string $charset
* @param boolean $double_encode
*
* @return string
*/
public static function htmlspecialchars($str, $quote_style = ENT_COMPAT, $charset = null, $double_encode = false)
{
return htmlspecialchars($str, $quote_style, null == $charset ? self::$instance->getEncoding() : $charset, $double_encode);
}
示例3: getEncoding
/**
* Get current encoding
*
* @return string
*/
public static function getEncoding()
{
return self::$instance->getEncoding();
}
示例4: htmlentities
/**
* Convert all applicable characters to HTML entities
*
* @param string $string The input string.
* @param integer $quote_style Quote style
* @param string $charset Character set, UTF-8 by default
* @param boolean $double_encode If set to false, no encoding of existing entities
*
* @return string
*/
public static function htmlentities($string, $quote_style = ENT_COMPAT, $charset = null, $double_encode = true)
{
return htmlentities($string, $quote_style, null == $charset ? self::$instance->getEncoding() : $charset, $double_encode);
}