note 72470 deleted from function.is-numeric by cmb

From: Date: Sun, 23 Jun 2019 10:36:25 +0000
Subject: note 72470 deleted from function.is-numeric by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-211353@lists.php.net to get a copy of this message
Note Submitter: mariusads::at::helpedia.com ---- Test if a number is positive and contains only 0-9: function is_number($number) { $text = (string)$number; $textlen = strlen($text); if ($textlen==0) return 0; for ($i=0;$i < $textlen;$i++) { $ch = ord($text{$i}); if (($ch<48) || ($ch>57)) return 0; } return 1; } returns 0 : number contain character outside 0-9 1 : valid number.

« previous php.notes (#211353) next »