note 120598 deleted from function.is-numeric by crell
| From: | crell@php.net | Date: | Mon, 18 Apr 2022 14:52:45 +0000 |
| Subject: | note 120598 deleted from function.is-numeric by crell | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-218268@lists.php.net to get a copy of this message | ||
Note Submitter: cottton
----
As of http://php.net/manual/de/function.is-numeric.php#111709
' 12345' is considered numeric.
BUT '12345 ' NOT.
Test:
<?php
foreach (
[
' 12345',
'12345 ',
' 12345 ',
] as $value
) {
echo "'{$value}'\t" . var_export(is_numeric($value), true) . PHP_EOL;
}
/**
* Output:
*
* ' 12345' true
* '12345 ' false
* ' 12345 ' false
*/
?>