

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
sizeof() function in PHP
The sizeof() function in PHP is an alias of count() function. The sizeof() function counts elements in an array, or properties in an object. It returns the number of elements in an array.
Syntax
sizeof(arr, mode)
Parameters
arr − The specified array.
mode − Specifies the mode. Possible values are 0 or 1. 0: Do not count all the elements, 1: Count all the elements.
Return
The sizeof() function returns the number of elements in an array.
Example
The following is an example −
<?php $students = array("Jack","Peter", "Anne","David"); echo sizeof($students); ?>
Output
The following is the output −
4
- Related Questions & Answers
- Sizeof operator in C
- What is sizeof operator in C++?
- file_exists() function in PHP
- basename( ) function in PHP
- chgrp()function in PHP
- chmod() function in PHP
- chown() function in PHP
- clearstatcache() function in PHP
- copy() function in PHP
- delete() function in PHP
- dirname()function in PHP
- disk_free_space() function in PHP
- disk_total_space() function in PHP
- diskfreespace() function in PHP
- fclose() function in PHP
Advertisements