fgets moves the position in the file pointer, you need

echo (time()).">><br>";
$old=fgets($fp);
echo $old." = <br>";
$new=time();
echo ">>>".($new - $old)."<<<<br>";




pei_world wrote:

I have a problem in time substraction.
the number print out correct, but don't know
why i cann't do the substraction between them
=======================================
   echo (time()).">><br>";
   echo (fgets($fp))." = <br>";
   $new=time();
   $old=fgets($fp);
   echo ">>>".($new - $old)."<<<<br>";

ouput ======================================

1047832384>>
1047832349 =


1047832384<<<




--
Sincerely your;

pei_world ( .::IT::. )










--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to