I'm doing what should be a simple file_exists query. I've got the following basic code:
$stripdate = "0";
$testdate = date("ymd");
do {
if (file_exists("$DOCUMENT_ROOT/./images/strips/".$testdate.".gif")) {
$stripdate = $testdate;
echo "found";
}
else {
// subtract one from the date
}
}
while ($stripdate == "0")
... and this works fine. It finds the specified files.
when I place it in a function, I can no longer use $DOCUMENT_ROOT to find the files. I have to go
file_exists("/home/blah/blah/blah/blah/images/strips/".$testdate.".gif")
as in:
function find_strip($testdate){
$stripdate = "0";
do {
if (file_exists("/home/blah/blah/blah/blah/images/strips/".$testdate.".gif")) {
$stripdate = $testdate;
echo "found";
}
else {
// subtract one from the date
}
}
while ($stripdate == "0")
}
find_strip(date("ymd"));
...
Anyone know how why this happens? Any way to be able to use $DOCUMENT_ROOT?
Thanks,
Thomas D