utdev utdev - 1 year ago 114
PHP Question

Php file_exists does not work

I want to check if a file in a directory exists.
I my case it does exist.

echo "is file";

Here is an image of that path:

enter image description here

But somehow this does not work.

Answer Source

Forward slashes will also work on Windows. You can use forward slashes so you do not need to escape them:

if (file_exists("C:/xampp/htdocs/myApp/img1.jpg"))
    echo "file exists";
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download