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

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

图片转代码服务由CSDN问答提供 功能建议

我一直收到这个php错误:

Parse 错误:语法错误,第635行/home/ExpandHosting/www/FTP/ftp.php中文件的意外结束

我试过谷歌搜索和所有我 发现是我忘了关闭一个if语句或者类似的。 我曾多次尝试阅读我的文件,但我无法找到我搞砸的地方。 这发生在我开始评论之后很多,所以我可能删除/评论了一个括号,但我找不到它!

这是源代码: 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!
    
    已采纳该答案
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题