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 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作