本文整理汇总了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);
}