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 关于大棚监测的pcb板设计
  • ¥20 sim800c模块 at指令及平台
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计