is_numeric fails and don't know why

From: Date: Fri, 07 Feb 2003 12:29:23 +0000
Subject: is_numeric fails and don't know why
Groups: php.general 
Request: Send a blank email to php-general+get-134743@lists.php.net to get a copy of this message
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

« previous php.general (#134743) next »