![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
PHP getrandmax() Function
Definition and Usage
The getrandmax() function returns largest integer that can be used in PHP. Value returned by this function serves as the upper limit for rand() function to generate random number.
This function always returns an integer.
Syntax
getrandmax ( void ) : int
Parameters
Sr.No | Parameter & Description |
---|---|
1 | This function needs no parameters |
Return Values
PHP getrandmax() function returns largest possible integer that can be used in PHP. On 64 bit Windows, the number is 2147483647
PHP Version
This function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.
Example
Following example returns largest possible integer−
<?php echo "Largest Integer = " . getrandmax() . "
"; ?>
Output
This may produce following result (it being a random number, it is more likely to return different number every time)−
Largest Integer = 2147483647
Advertisements