TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 11-28-2008, 05:40 AM   #1 (permalink)
The Acquainted
 
Peuplarchie's Avatar
 
Join Date: May 2008
Location: Québec
Posts: 104
Thanks: 10
Peuplarchie is on a distinguished road
Application 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 !
__________________
That's why we are not alone on earth... let's build !
Peuplarchie is offline  
Reply With Quote
Old 11-28-2008, 05:44 AM   #2 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

Try
PHP Code:
opendir(date('Y/m/d')); 
__________________

Village Idiot is offline  
Reply With Quote
Old 11-28-2008, 06:14 AM   #3 (permalink)
The Acquainted
 
Peuplarchie's Avatar
 
Join Date: May 2008
Location: Québec
Posts: 104
Thanks: 10
Peuplarchie is on a distinguished road
Default

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 '{'
__________________
That's why we are not alone on earth... let's build !
Peuplarchie is offline  
Reply With Quote
Old 11-28-2008, 09:06 AM   #4 (permalink)
The Addict
 
zxt3st's Avatar
 
Join Date: Apr 2008
Posts: 200
Thanks: 18
zxt3st is on a distinguished road
Default

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
__________________
Serenity Project - 5% (Layout) - Ongoing....
Project Serenity Free Life!....
zxt3st is offline  
Reply With Quote
Old 11-28-2008, 10:46 AM   #5 (permalink)
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default

Yes there is:
PHP: Comparison Operators - Manual
__________________
Tanax is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 06:27 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design