on 09/03/03 8:10 AM, Charles Kline ([EMAIL PROTECTED]) wrote:
> if(file_exists('cherpdocs/$annrow[id].doc')){
> echo "Funding
> details paper";
> }
This is a pretty simple debugging type query, so:
First things first, make sure that $annrow[id] is what you expect, by
echoing it to the screen.
"
At 22:40 08.03.2003, Khalid El-Kary said:
[snip]
>because you can't directly use the $annrow[id] within single quotes, you
>should use double quotes to do so.
>
>file_exists("cherpdocs/$annrow[id].doc")
>
>or
>
>file_exists('cherpdocs/'.$annrow[id].'.doc')
>
You will probably need to use
file_exists("cherpdocs/{$annrow['id']}.doc") you could also use
file_exists('cherpdocs/' . $annrow['id'] . '.doc')
You should use single quotes to identify your element in an array,
otherwise PHP will try to use it as a constant first.
Jason
On Sat, 2003-03-08 at 14
because you can't directly use the $annrow[id] within single quotes, you
should use double quotes to do so.
file_exists("cherpdocs/$annrow[id].doc")
or
file_exists('cherpdocs/'.$annrow[id].'.doc')
or
file_exists("cherpdocs/".$annrow[id].".doc")
Note: i heared it's prefered to always use the
: <[EMAIL PROTECTED]>
Sent: Saturday, March 08, 2003 1:10 PM
Subject: [PHP] file_exists() question
> Can anyone tell me why this code does not return true when the file in
> the directory cherpdocs/ with the file (which I see as being there)
> does exist?
>
> if(file_exists('ch
Can anyone tell me why this code does not return true when the file in
the directory cherpdocs/ with the file (which I see as being there)
does exist?
if(file_exists('cherpdocs/$annrow[id].doc')){
echo "Funding
details paper";
}
This is a path relative to the file calling it, should i
6 matches
Mail list logo