How to check whether a value is a legal finite number or not in PHP

1 Answer

0 votes
if (is_finite(3.14159265359))
    echo "yes <br />\n";
if (is_finite(10000000))
    echo "yes <br / >\n";
if (is_finite(log(0)))
    echo "yes <br / >\n";
else
    echo "no <br / >\n";


/*
run: 

yes 
yes 
no 

*/

 



answered Jun 30, 2016 by avibootz

Related questions

1 answer 169 views
1 answer 160 views
2 answers 228 views
2 answers 2,798 views
4 answers 223 views
...