教程集 www.jiaochengji.com
教程集 >  脚本编程  >  php  >  正文 PHP Parse Error: syntax error, unexpected $end 错误的解决办法

PHP Parse Error: syntax error, unexpected $end 错误的解决办法

发布时间:2018-12-03   编辑:jiaochengji.com
教程集为您提供PHP Parse Error: syntax error, unexpected $end 错误的解决办法等资源,欢迎您收藏本站,我们将为您提供最新的PHP Parse Error: syntax error, unexpected $end 错误的解决办法资源
php程序员可能会经常碰到PHP Parse Error: syntax error, unexpected $end 错误,下面我来给各位朋友详细总结导致PHP Parse Error: syntax error, unexpected $end 错误原因分析与解决办法吧。

错误如下:

Parse error: syntax error, unexpected $end in D:xampphtdocsguestBookguestBook.php on line 330

网上查了很多朋友说是因为php.ini中设置short_open_tag = On导致了错误,其它这个个觉得与这个关系不大,主要是出现在你编程基本处理上的问题

例:

<table width="620" align="center" border="0" cellpadding="1" cellspacing="1" style="background:#FB7"> <tr> <td width="464" height="27" bgcolor="#FFE7CE"> 代码如下</td> <td width="109" align="center" bgcolor="#FFE7CE" style="cursor:pointer;" onclick="doCopy('copy7456')">复制代码</td> </tr> <tr> <td height="auto" colspan="2" valign="top" bgcolor="#FFFFFF" style="padding:10px;" class="copyclass" id=copy7456>

$a =1;

if($a)
{
 echo $a;
}
else
{

运行之后会出现

Parse error: syntax error, unexpected $end in E:wwwtest.php on line 126 错误了,

从上面代码看我们是if{}else{}未结束导致了,我们只要把

<table width="620" align="center" border="0" cellpadding="1" cellspacing="1" style="background:#FB7"> <tr> <td width="464" height="27" bgcolor="#FFE7CE"> 代码如下</td> <td width="109" align="center" bgcolor="#FFE7CE" style="cursor:pointer;" onclick="doCopy('copy7988')">复制代码</td> </tr> <tr> <td height="auto" colspan="2" valign="top" bgcolor="#FFFFFF" style="padding:10px;" class="copyclass" id=copy7988>

$a =1;

if($a)
{
 echo $a;
}
else
{
}

加上}即可了。

您可能感兴趣的文章:
PHP Parse Error: syntax error, unexpected $end 错误解决办法
php syntax error, unexpected $end 错误怎么解决
php异常:Parse error: syntax error, unexpected eval()'d code error
PHP Parse Error: syntax error, unexpected $end 错误的解决办法
Parse Error: syntax error, unexpected $end 错误的解决方法
Parse Error: syntax error, unexpected $end 错误
php异常parse error: syntax error, unexpected t_var错误怎么解决
php语法错误
帝国cms设置及服务器本身问题引起的错误提示解决方法
分析PHP错误处理(核心特性)

[关闭]
~ ~