请问这段代码哪里出错了?提示Parse error: syntax error, unexpected T_ELSEIF in
代码如下:functionvbstrlen($string,$unhtmlspecialchars=false){$string=preg_replace('#&\#([...
代码如下:
function vbstrlen($string, $unhtmlspecialchars = false)
{
$string = preg_replace('#&\#([0-9]+);#', '_', $string);
if ($unhtmlspecialchars)
{
// don't try to translate unicode entities ever, as we want them to count as 1 (above)
$string = unhtmlspecialchars($string, false);
}
if (function_exists('mb_strlen') AND $length = @mb_strlen($string, vB_Template_Runtime::fetchStyleVar('charset')))
{
return $length;
}
elseif (strtolower($stylevar['charset']) == 'utf-8')
{
return strlen(utf8_decode($string));
}
else
{
return strlen($string);
}
}
错误提示:
Parse error: syntax error, unexpected T_ELSEIF in D:\web\phpnow\htdocs\***\includes\functions.php on line 349
第349行 就是 elseif (strtolower($stylevar['charset']) == 'utf-8') 展开
function vbstrlen($string, $unhtmlspecialchars = false)
{
$string = preg_replace('#&\#([0-9]+);#', '_', $string);
if ($unhtmlspecialchars)
{
// don't try to translate unicode entities ever, as we want them to count as 1 (above)
$string = unhtmlspecialchars($string, false);
}
if (function_exists('mb_strlen') AND $length = @mb_strlen($string, vB_Template_Runtime::fetchStyleVar('charset')))
{
return $length;
}
elseif (strtolower($stylevar['charset']) == 'utf-8')
{
return strlen(utf8_decode($string));
}
else
{
return strlen($string);
}
}
错误提示:
Parse error: syntax error, unexpected T_ELSEIF in D:\web\phpnow\htdocs\***\includes\functions.php on line 349
第349行 就是 elseif (strtolower($stylevar['charset']) == 'utf-8') 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询