本文整理汇总了PHP中Str::pure2html方法的典型用法代码示例。如果您正苦于以下问题:PHP Str::pure2html方法的具体用法?PHP Str::pure2html怎么用?PHP Str::pure2html使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Str
的用法示例。
在下文中一共展示了Str::pure2html方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetAsHTML
public function GetAsHTML($sValue, $oHostObject = null, $bLocalize = true)
{
return Str::pure2html((string) $sValue);
}
示例2: get_callstack
public static function get_callstack($iLevelsToIgnore = 0, $aCallStack = null)
{
if ($aCallStack == null) {
$aCallStack = debug_backtrace();
}
$aCallStack = array_slice($aCallStack, $iLevelsToIgnore);
$aDigestCallStack = array();
$bFirstLine = true;
foreach ($aCallStack as $aCallInfo) {
$sLine = empty($aCallInfo['line']) ? "" : $aCallInfo['line'];
$sFile = empty($aCallInfo['file']) ? "" : $aCallInfo['file'];
if ($sFile != '') {
$sFile = str_replace('\\', '/', $sFile);
$sAppRoot = str_replace('\\', '/', APPROOT);
$iPos = strpos($sFile, $sAppRoot);
if ($iPos !== false) {
$sFile = substr($sFile, strlen($sAppRoot));
}
}
$sClass = empty($aCallInfo['class']) ? "" : $aCallInfo['class'];
$sType = empty($aCallInfo['type']) ? "" : $aCallInfo['type'];
$sFunction = empty($aCallInfo['function']) ? "" : $aCallInfo['function'];
if ($bFirstLine) {
$bFirstLine = false;
// For this line do not display the "function name" because
// that will be the name of our error handler for sure !
$sFunctionInfo = "N/A";
} else {
$args = '';
if (empty($aCallInfo['args'])) {
$aCallInfo['args'] = array();
}
foreach ($aCallInfo['args'] as $a) {
if (!empty($args)) {
$args .= ', ';
}
switch (gettype($a)) {
case 'integer':
case 'double':
$args .= $a;
break;
case 'string':
$a = Str::pure2html(self::beautifulstr($a, 64, true, false));
$args .= "\"{$a}\"";
break;
case 'array':
$args .= 'array(' . count($a) . ')';
break;
case 'object':
$args .= 'Object(' . get_class($a) . ')';
break;
case 'resource':
$args .= 'Resource(' . strstr($a, '#') . ')';
break;
case 'boolean':
$args .= $a ? 'true' : 'false';
break;
case 'NULL':
$args .= 'null';
break;
default:
$args .= 'Unknown';
}
}
$sFunctionInfo = "{$sClass}{$sType}{$sFunction}({$args})";
}
$aDigestCallStack[] = array('File' => $sFile, 'Line' => $sLine, 'Function' => $sFunctionInfo);
}
return $aDigestCallStack;
}