I want to check if a file in a directory exists. I my case it does exist.
if(file_exists("C:\\xampp\\htdocs\\myApp\\img1.jpg"))
{
echo "is file";
exit;
}
Here is an image of that path:
But somehow this does not work.
Please use only one \ and follow bellow :
if(file_exists("C:\xampp\htdocs\myApp\img1.jpg"))
{
echo "is file";
exit;
}
or
if(file_exists("img1.jpg"))
{
echo "is file";
exit;
}
because img1.jpg is your project root folder
C:if(file_exists("C://xampp/htdocs/myApp/img1.jpg"))