TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Advanced PHP Programming (http://www.talkphp.com/advanced-php-programming/)
-   -   opendir('Y/m/d') ??? (http://www.talkphp.com/advanced-php-programming/3662-opendir-y-m-d.html)

Peuplarchie 11-28-2008 05:40 AM

opendir('Y/m/d') ???
 
Good day to you all,
my question this time seems easy but, I dont have a clue on how to do this...

I would like to read the directory of today...

PHP Code:


if ($handle opendir('Y/m/d,time()')) { 

Can somebody help me in wording this ?

Thanks !

Village Idiot 11-28-2008 05:44 AM

Try
PHP Code:

opendir(date('Y/m/d')); 


Peuplarchie 11-28-2008 06:14 AM

Thanks but i don't know if it's my function but it don't work :

PHP Code:



function compileList($extensions)
{
     if (
$handle opendir(date('Y/m/d')) {
   while (
false !== ($file readdir($handle)))
      {
          
$ext strtolower(end(explode('.'$file)));
       
          if (
in_array($ext$extensions) AND $file != "." AND $file != "..")
              {
                  
$files[$file]=implode(file($file));
              }
       }
  
closedir($handle);
  }
  
if (empty(
$files))
{

    return 
null;
}
return 
$files;  


it give me an error on line tree..

Parse error: syntax error, unexpected '{'

zxt3st 11-28-2008 09:06 AM

Just a quick overview on your code.
PHP Code:

while (false !== ($file readdir($handle))) 

I dont think if there is an "!==" operator ever exist in php. Check in here PHP Operators

Tanax 11-28-2008 10:46 AM

Yes there is:
PHP: Comparison Operators - Manual


All times are GMT. The time now is 09:31 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0