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_countable() Function
Next article icon

PHP | is_countable() Function

Last Updated : 21 Apr, 2020
Comments
Improve
Suggest changes
Like Article
Like
Report
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 value which need to be checked.
Return Value: This function returns a boolean value i.e. either True if value of variable is countable otherwise returns False. Below programs illustrate the is_countable() function in PHP: Program 1: php
<?php  // Declare a string $str = "GeeksforGeeks";   var_dump(is_countable($str));  $arr = array(1, 3, 5, 7);  var_dump(is_countable($arr)); ?>  
Output:
bool(false)   bool(true) 
Program 2: php
<?php  // Declare a number $num = 1234; var_dump(is_countable($num));  // Declare an array $arr = array('Welcome', 'to', 'GeeksforGeeks'); var_dump(is_countable($arr));  // Declare a string $str = "GeeksforGeeks";  var_dump(is_countable($str));  // Declare an empty class class GFG {     // Empty class }  // Create an object of class $obj = new GFG(); var_dump(is_countable($obj));  // Create an array iterator object $itr = new ArrayIterator(); var_dump(is_countable($itr)); ?>  
Output:
bool(false)   bool(true)   bool(false)   bool(false)   bool(true)
Reference: https://www.php.net/manual/en/function.is-countable.php

Next Article
PHP | is_countable() Function

A

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

Similar Reads

    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 count() Function
    The count() function in PHP is used to count the number of elements in an array or the countable properties of an object. The function returns an integer value representing the number of items present.Syntax:count($array, mode)In this syntax:$array (mandatory): Refers to the array, whose elements ar
    3 min read
    PHP DsSet count() Function
    The Ds\Set::count() function of Ds\Set class in PHP is an inbuilt function which is used to count the number of values present in the Set. This is also referred to as the size of the Set instance. Syntax: int public Ds\Set::count() Parameters: This function does not accept any parameter. Return Valu
    1 min read
    PHP is_float() Function
    PHP is_float() is an inbuilt function in PHP. The is_float() function is used to find whether a variable is a float or not. Syntax: boolean is_float($variable_name) Parameter: This function contains a single parameter as shown in the above syntax and described below $variable_name: the variable we w
    2 min read
    PHP iterator_count() Function
    The iterator_count() function is an inbuilt function in PHP that is used to count the number of elements in an iterator. An iterator is an object that is a collection of elements. Syntax: iterator_count(Traversable $iterator) : intParameters: This function accepts only one parameter which is describ
    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