Re: for loop not working

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

 



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: pgp8rxt9a7DhQ.pgp
Description: PGP signature


[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