打开网站显示PHP Parse error: syntax error, unexpected token "class", expecting variable (T_VARIABLE) in ...错误怎么办|已解决
错误提示:PHP Parse error: syntax error, unexpected token "class", expecting variable (T_VARIABLE) in ...
原因:将PHP关键字(如class、function、if、else、for、while、echo等)用作变量名、函数名或类名,违反语法规则。
解决方案:修改名称,避开PHP关键字,修正后:
<?php
$className = "Test";
echo $className;
?>

扫码添加技术【解决问题】
专业解决各种疑难杂症,您有任何问题都可联系我们技术人员。
本文来自博客园,作者:可有仙子迎风立,转载请注明原文链接:https://www.cnblogs.com/xztime/p/19706193

浙公网安备 33010602011771号