Re: file_exists() question
| From: | Khalid El-Kary | Date: | Sat, 08 Mar 2003 21:40:10 +0000 |
| Subject: | Re: file_exists() question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-138784@lists.php.net to get a copy of this message | ||
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 "." when including variables within strings.
Regards,
Khalid Al-Kary
http://creaturesx.ma.cx/kxparse/
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')){_________________________________________________________________ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemailecho "<br /><a href=\"cherpdocs/$annrow[id].doc\">Funding details paper</a>";} This is a path relative to the file calling it, should it be otherwise? Thanks Charles -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php