Re: for loop not working
| From: | Paladin | Date: | Sat, 14 Jun 2014 18:59:34 +0000 |
| Subject: | Re: for loop not working | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-323455@lists.php.net to get a copy of this message | ||
On , hadi wrote:
> Hi ,
>
> Can someone help me to fix my code. It throwing error. I couldn't determine
> how to do the for loop.
>
> Here is my code
> [..]
Hi, take a look at glob function.. you cannot loop over filesystem
directly. use glob and loop over it's result
you will want something like
<?php
$files = glob('/tmp/sess*')
foreach ($files as $file) {
// do something with file $file
}
Hope it'll help,
Paladin
--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
Attachment: [application/pgp-signature]
Attachment: [application/pgp-signature]