• PHP Video Tutorials

PHP - is_double() Function


Advertisements

Definition and Usage

The is_double () function is used to test whether a variable is a float or not. The function is an alias of is_float().

Syntax

bool is_double (mixed   $value)

Parameters

Sr.No Parameter & Description
1

value

The variable being evaluated.

Return Values

This function returns true if value is a float, false otherwise.

Dependencies

PHP 4 and above

Example

Following example demonstrates return values with different types of variables −

<?php
   var_dump(is_double(10.01));    //outputs-bool(true)
   var_dump(is_double('def'));    //outputs-bool(false)
   var_dump(is_double(33));       //outputs-bool(false)
   var_dump(is_double(33.8));     //outputs-bool(true)
   var_dump(is_double(2e7));      //Scientific Notation    //outputs-bool(true)
   var_dump(is_double(false));    //outputs-bool(false)
?>

Output

This will produce following result −

bool(true)
bool(false)
bool(false)
bool(true)
bool(true)
bool(false)
php_variable_handling_functions.htm

Useful Video Courses


Video

PHP Online Training

45 Lectures 9 hours

Malhar Lathkar

Video

Become PHP Facebook Developer: Password-Less Authentication

34 Lectures 4 hours

Syed Raza

Video

Ultimate PHP & MySQL Web Development Course & OOP Coding

84 Lectures 5.5 hours

Frahaan Hussain

Video

Learn PHP from Scratch

17 Lectures 1 hours

Nivedita Jain

Video

E Commerce Website Development In PHP With PDO

100 Lectures 34 hours

Azaz Patel

Video

PHP in Telugu

43 Lectures 5.5 hours

Vijay Kumar Parvatha Reddy

Advertisements