Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • PHP Tutorial
  • PHP Exercises
  • PHP Array
  • PHP String
  • PHP Calendar
  • PHP Filesystem
  • PHP Math
  • PHP Programs
  • PHP Array Programs
  • PHP String Programs
  • PHP Interview Questions
  • PHP GMP
  • PHP IntlChar
  • PHP Image Processing
  • PHP DsSet
  • PHP DsMap
  • PHP Formatter
  • Web Technology
Open In App
Next Article:
PHP | is_double() Function
Next article icon

PHP | is_double() Function

Last Updated : 21 Apr, 2020
Comments
Improve
Suggest changes
Like Article
Like
Report
The is_double() function is an inbuilt function in PHP which is used to find whether the given value is a double or not. Syntax:
bool is_double( $variable_name )
Parameters: This function accepts one parameter as mentioned above and described below:
  • $variable_name: This parameter holds the value which need to check.
Return Value: It is a boolean value i.e. either TRUE if $variable_name contains is a double value, otherwise returns FALSE. Below programs illustrate the is_double() function in PHP: Program 1: php
<?php  // PHP code to implement is_double()  // function  function square($num)  {      return (is_double($num));  }   echo square(9.09) ."\n"; // outputs '1'.  echo square(FALSE) ."\n"; // gives no output.  echo square(14) ."\n"; // gives no output.  echo square(56.30) ."\n"; // outputs '1'   ?>  
Output:
  1      1  
Program 2: php
<?php  // PHP code to implement is_double() // function  $variable_name1 = 67.099;  $variable_name2 = 32;  $variable_name3 = "abc";  $variable_name4 = FALSE;   // $variable_name1 is double value, gives TRUE  if (is_double($variable_name1))      echo "$variable_name1 is a double value. \n";  else     echo "$variable_name1 is not a double value. \n";   // $variable_name2 is not a double value, gives FALSE  if (is_double($variable_name2))      echo "$variable_name2 is a double value. \n";  else     echo "$variable_name2 is not a double value. \n";   // $variable_name3 is not a double value, gives FALSE  if (is_double($variable_name3))      echo "$variable_name3 is a double value. \n";  else     echo "$variable_name3 is not a double value. \n";   // $variable_name4 is not a double value, gives FALSE  if (is_double($variable_name4))      echo "FALSE is a double value. \n";  else     echo "FALSE is not a double value. \n";  ?>  
Output:
  67.099 is a double value.   32 is not a double value.   abc is not a double value.   FALSE is not a double value.  
Reference: https://www.php.net/manual/en/function.is-double.php

Next Article
PHP | is_double() Function

A

ashokjaiswal
Improve
Article Tags :
  • Web Technologies
  • PHP
  • PHP-function

Similar Reads

    PHP | is_countable() Function
    The is_countable() function is an inbuilt function in PHP which is used to check whether the content of the variable is countable or not. Syntax: bool is_countable ( mixed $var ) Parameters: This function accepts one parameter as mentioned above and described below: $var: This parameter holds the va
    1 min read
    PHP | doubleval() Function
    The doubleval() is an inbuilt function in PHP which is used to get a float value of a variable. This function is an alias of floatval(). Syntax: doubleval ( $variable_name ) Parameters: This function accepts one parameter $variable_name as shown in above syntax. It is a mandatory parameter. This par
    1 min read
    PHP is_file( ) Function
    The is_file() function in PHP is an inbuilt function which is used to check whether the specified file is a regular file or not. The name of the file is sent as a parameter to the is_file() function and it returns True if the file is a regular file else it returns False. Syntax: bool is_file($file)
    2 min read
    PHP | is_callable() Function
    The is_callable() function is an inbuilt function in PHP which is used to verify the contents of a variable can be called as a function. It can check that a simple variable contains the name of a valid function, or that an array contains a properly encoded object and function name. Syntax: bool is_c
    2 min read
    PHP | is_dir( ) Function
    The is_dir() function in PHP used to check whether the specified file is a directory or not. The name of the file is sent as a parameter to the is_dir() function and it returns True if the file is a directory else it returns False. Syntax: is_dir($file) Parameters Used: The is_dir() function in PHP
    1 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences