Its not very clear what you want to achieve with that code snippet.
If you are pulling database rows out of your database with
mysql_fetch_array(), then you do not need a foreach loop.
I think you may want something like this, but without knowing your
database table structure and the query yo
You could run the script as a daemon. man daemon.
The sloppy way of running the script every 30 seconds would be to use
sleep(30), but that would cause the script to run at 30 seconds +
execution time.
If you make a loop like this you could get around that:
$t=time()+31;
while(true){
Sorry, slight adjustment, make that $t=time()-31; in the first line so
that the script runs immediately.
> You could run the script as a daemon. man daemon.
>
> The sloppy way of running the script every 30 seconds would be to use
sleep(30), but that would cause the script to run at 30 seconds
natsort() places the array elements in natural order but not the keys.
If you want your elements printed using "print" in a loop either
reorganise the keys first or use "foreach".
The easiest method would be to use:
foreach($dl as $filename){
print $filename;
}
If you insist on using
4 matches
Mail list logo