Jump to content

if_exists


kev

Recommended Posts

Hello all.

 

<?php

 

$file_name = ("file_type.php");

if (file_exists($file_name)) {

echo ("$file_name does exist.");

}

else {

echo ("$file_name does not exist.");

}

?>

 

According to the source for this file the echo should have been:

file_type.php does exist.

Unfortunately the oposite happened:

file_type.php does not exist.

 

kev....

 

Link to comment
Share on other sites

Hello scootsah.

 

The script is a piece of standalone script from a book turorial. I half guessed that the full path or something was missing but I wondered also if there had been some PHP change somewhere.

By all accounts the book I have is a litany of minor errors most of which were waiting for me.

The next example in line has the same problem but dealing with 'is_readable', 'is_writeable' and 'is_excecutable'. I will take it as a standalone script nothing will work as it is meant to.

Thanks scootsah.

kev

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.