Re: detect if file exist

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/21/06, Alain Roger <raf.news@xxxxxxxxx> wrote:
i have 1 folder, in this folder sometime a file can be sometimes not...

1. i would like to detect if the folder contains a file or not.
only 1 file can be in this folder but i do not know the name of this file,
and the extension should be xls.

Use the glob function: php.net/glob. Something like:

$f = glob('*.xls');
if ( count($f) )
$file = $f[0];
else
 die('no file');

Rabin

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux