RE: Re: get file from directory.

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

 



> If you know the directory and you know the filename, why do a search at
all?
> Just open it.

Here is my problem I want to search a directory and get file match "$ip"
variable as mention in  my code.

Can this be done.  



> <?php
> >
> >
> > function timeout($username, $ip)
> >
> > {
> >
> >
> > $iplookup = glob('/var/log/phplogs/iplogs/');
> >
> >
> > foreach(glob('/tmp/sess*') as $file) {
> >      if (time()- filemtime($ip) > 60)
> >
> > {
> >          $old = "$username";
> >          $content = file_get_contents($file);
> >          if(strpos($content, $old) !== false) {
> >              unlink($file);
> >          }
> >      }
> > }
> >
> > }
> > ?>

> On 6/23/2014 2:17 PM, hadi wrote:
> > Can someone help.
> >
> > How to get specific file from directory.
> >
> > Thank you.
> >
> >
> >
> If you know the directory and you know the filename, why do a search at
all?
> Just open it.
> 
> --
> PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
> http://www.php.net/unsub.php

<<attachment: smime.p7s>>


[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