php help please thanks?

I'm lost what is your question?

file_exists is a built in PHP function that returns true or false ( 0 or 1 ) depending on if the file was found.

To proper look for a file and use it in an IF statement you must use it like so:

$file_name = 'myfile.php'; // Can also be path to th file like: ../folder/folder/myfile.php
$check = file_exists ($file_name);

if ($check==true){
echo 'The file exists - Carry out code in these brackets';
} else {
echo 'Didn't find the file - Carry out code in these brackets';
}

Now you may also look for a folder (directory). To do this you do the same as above only with is_dir NOT file_exists.

Why do you look up any code issues you have in the easy to use PHP manual here http://php.net/
 
f(file_exists($file_name))
f(file_exists($file_name))8934
&^&@*#^$#*&68f(file_exists($file_name))KSKADHghsgj
f(file_exists($file_name))78927358979!!!!!!!!!!!!
@@@@@f(file_exists($file_name))jksdhfjkhkj12467845
 
file_exists() is a function

It takes an argument, which goes inside its set of brackets. It returns a boolean (true/false) value; true if the file specified in the argument exists, and false if it doesn't.

In this case, the argument is $file_name. So, we get:
file_exists($file_name)

'if' executes some code (which you haven't included) if the statement in the brackets evaluates to "true".

So, if file_exists($file_name) returns "true", then if will execute some code.
 
Back
Top