note 78875 deleted from function.intval by cmb
| From: | cmb@php.net | Date: | Sun, 16 Feb 2020 13:51:01 +0000 |
| Subject: | note 78875 deleted from function.intval by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-214149@lists.php.net to get a copy of this message | ||
Note Submitter: lrdsatyr8 at hotmail dot com
----
If you just want to get the integer value of a number without all the hassle, just use intval()...
like so:
$a1 = 10.4;
$a2 = -12.5;
$a3 = 44.1238503;
print intval($a1); // returns 10
print intval($a2); // returns -12
print intval($a3); // returns 44
it's that easy!