file_exists()函数不返回值 [英] file_exists() function doesn't return a value

查看:426
本文介绍了file_exists()函数不返回值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我在Google搜索中遇到了一个很酷的功能,名为file_exists,可以完全按照我的需要去做。不幸的是,我认为我正在使用的逻辑有问题,因为它返回的值为null而不是true或false。如果我在基本目录中检查某些东西似乎工作得很好,但是当我尝试在root之外的东西时,它会失败。检查文件代码如下所示:

展开 | 选择 | Wrap | 行号

解决方案

Heya,cooldht。


发布源代码时请使用CODE标签。请在下次发布时查看页面右侧的REPLY GUIDELINES。


您的服务器运行的操作系统是什么?


尝试检查错误


Hi PB,

很抱歉遗漏了这些标签。我假设你想知道服务器上的PHP版本。那是4.3.8-1.1。以防万一,MYSQL版本为3.23.58-4。


谢谢!


cooldht


< blockquote>再次抱歉,


我忘了提到我在页面上进行了调试,并且没有收到任何错误消息。


谢谢,


ct


Hi all,

I ran into a cool function in a google search, called file_exists that would do exactly what I need it to do. Unfortunately, I think something is wrong with the logic I''m using, because it returns a value of null instead of true or false. It seems to work great if I check for something in the base directory, but when I try something outside of the root, it fails. The check file code looks like this:

Expand|Select|Wrap|Line Numbers

解决方案

Heya, cooldht.

Please use CODE tags when posting source code. See the REPLY GUIDELINES on the right side of the page next time you post.

What OS is your server running?

Try checking for errors.


Hi PB,

Sorry about leaving out the tags. I''m assuming you wanted to know the PHP version on the server. That is 4.3.8-1.1. Just in case, the MYSQL version is 3.23.58-4.

Thanks!

cooldht


Sorry again,

I forgot to mention that I have the debugging on in the page, and didn''t receive any error messages.

Thanks,

ct


这篇关于file_exists()函数不返回值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆