Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,864 questions

51,786 answers

573 users

How to check whether the type of a variable is float in PHP

2 Answers

0 votes
if (is_float(3.14)) 
    echo "float";
else 
    echo "not float";


/*
run: 

float 

*/

 



answered Jun 30, 2016 by avibootz
0 votes
echo "<pre>";
var_dump(is_float(23432372.5));
var_dump(is_float('xyz'));
var_dump(is_float(100));
var_dump(is_float(1e5)); 
var_dump(is_float(true));
echo "<pre>";


/*
run: 

bool(true)
bool(false)
bool(false)
bool(true)
bool(false)

*/

 



answered Jun 30, 2016 by avibootz

Related questions

1 answer 201 views
8 answers 385 views
4 answers 194 views
2 answers 192 views
3 answers 244 views
3 answers 268 views
1 answer 216 views
...