dqx76962 2014-04-09 22:41
浏览 158
已采纳

PHP EOF语法错误

I keep getting this php error:

Parse error: syntax error, unexpected end of file in /home/ExpandHosting/www/FTP/ftp.php on line 635

I have tried googling around and all I find is that I forgot to close a if statement or similiar. I have tried reading through my file several times but I can't find where I messed up. This happened after I started commenting a lot so I might have removed/commented a bracket but I can't find it!

Here is the source code: http://pastebin.com/xyY8EN2W

  • 写回答

1条回答 默认 最新

  • drws65968272 2014-04-09 22:44
    关注

    Protip: Use your code editor's "Find" feature, type in {, then tell it to count the matches. Then repeat with }. If the numbers don't match, odds are high you missed a brace.

    Aside: Obviously, you may have a string that may not necessarily contain perfectly matches braces. In this case, I like to add a comment with the brace(s) needed to match the numbers. Example: preg_match("/\{abc.*/",$str); // }

    In your case, it's 68 vs. 67.

    Now use your code editor's bracket matching feature to find out which one is missing.

    If your code editor doesn't have these features, use one that does (personal preference is Notepad++)


    240.                if(file_exists($folderPath . "/" . $fileName))
    241.                {
    242.                        error($fileName . " already exists!!!");
    243.                        $error = true;
    244.      // MISSING } HERE!!          
    245. 
    246. 
    247.                # Checks if $file doesn't exist!
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 R语言卸载之后无法重装,显示电脑存在下载某些较大二进制文件行为,怎么办
  • ¥15 java 的protected权限 ,问题在注释里