note 114388 deleted from function.is-numeric by cmb
| From: | cmb@php.net | Date: | Sun, 23 Jun 2019 10:36:13 +0000 |
| Subject: | note 114388 deleted from function.is-numeric by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-211352@lists.php.net to get a copy of this message | ||
Note Submitter: Joris Berthelot
----
There's no way to check if a string contains a float number so here's a tricky one:
<?php
function isFloat($input)
{
return is_numeric(preg_replace('/[^-0-9\.]/', null, $input));
}