note 48734 deleted from function.is-numeric by felipe

From: Date: Thu, 03 Jan 2008 01:40:27 +0000
Subject: note 48734 deleted from function.is-numeric by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-134688@lists.php.net to get a copy of this message
Note Submitter: kiss dot pal at expert-net dot hu ---- function is_float_ex($pNum) { $num_chars=("0123456789.,+-"); if (strlen(trim($pNum))==0) // empty $pNum -> null return FALSE; else { $i=0; $f=1; // modify $v=strlen($num_chars)-$f; while (($i<strlen($pNum)) && ($v>=0)) { $v=strlen($num_chars)-$f; while (($v>=0) && ($num_chars[$v]<>$pNum[$i])) $v--; if ($f==1) // Only first item + vagy - $f=3; if (($pNum[$i]=='.') || ($pNum[$i]==',')) $f=5; $i++; } if ($v<0) return FALSE; else return TRUE; } }

« previous php.notes (#134688) next »