Created
April 15, 2013 19:57
-
-
Save emersonbroga/5390862 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$notFloat = '8521'; | |
//example 1: | |
var_dump(is_float($notFloat)); //bool(false) | |
//example 2: | |
var_dump(filter_var($notFloat, FILTER_VALIDATE_FLOAT)); //float(8521) | |
//example 3: | |
var_dump(is_float(filter_var($notFloat, FILTER_VALIDATE_FLOAT))); //bool(true) | |
//the example 3 was found at Respect\Validation\Rules\Float.php | |
//Run at http://writecodeonline.com/php/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment