PHP-General - Problrm with loop when use sleep function

Links for php scripts

Moderators: macek, egami, gesf

mojtabaesf
New php-forum User
New php-forum User
Posts: 1
Joined: Mon Nov 21, 2011 6:23 am

PHP-General - Problrm with loop when use sleep function

Postby mojtabaesf » Mon Nov 21, 2011 6:36 am

when i run this script in local my PC is OK . but when run the same script on server is strange and my loop run more than 32 .
PHP Code:
<?php
for ( $i = 0 ; $i < 32 ; $i++ )
{
$b = $i * 80 ;
$l = $b + 80 ;
for ( $c = $b ; $c < $l ; $c++ )
{
$s = $c + 1 ;
$array [] = $s ;
}
sleep (13);
$f = fopen("db.txt" , 'a+') ;
$z = $i + 1 ;
fwrite ($f , '(('.$z.'))-->>[[' );
foreach ( $array as $val )
{
fwrite ($f , $val.' ' );
}
fwrite ($f,"]]\n\n" );
$array = array();
}
?>


help me please :( :(

Return to “PHP Scripts”

Who is online

Users browsing this forum: No registered users and 2 guests