Hi,

I'm trying to read a file that contains a group of numbers, each of them in one line 
of the file. I need to verify that the file is valid, so i read line by line and test 
if the line is numeric:

...

$line = fgets ($FileDesc);
$line = trim ($line);
if (!is_numeric ($line))
   return 0;

...

It doesn't work for the first and last line of the file. Last line is a \r, so perhaps 
it's normal, but I don't understand why it fails with first line.

Example:

.101972E+00     (first line)
-.122713E+01
.784379E-01
-.135826E+01
-.217017E+01

... first line is not considered as a number. Rest of lines are considered as numbers. 
Where is the problem? Thanks for your help.
_____________________________________________________________________
Horas ilimitadas para leer y enviar correos con Tarifa Plana Wanadoo
¡¡ desde las 3 de la tarde!!
Compruébalo en http://www.wanadoo.es/acceso-internet


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

Reply via email to