|
INTERVIEW QUESTIONS
PROGRAMMING LANGUAGES
PHP
DETAILS
Question: what is the use of rand() in php?
Answer: It is used to generate random numbers.If called without the arguments it returns a pseudo-random integer between 0 and getrandmax(). If you want a random number between 6 and 12 (inclusive), for example, use rand(6, 12).This function does not generate cryptographically safe values, and should not be used for cryptographic uses. If you want a cryptographically secure value, consider using openssl_random_pseudo_bytes() instead.
|
|
|
Category |
PHP Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 7421 users |
Added on |
8/27/2016 |
Views |
66013 |
Rate it! |
|
|
Question:
what is the use of rand() in php?
Answer:
It is used to generate random numbers.If called without the arguments it returns a pseudo-random integer between 0 and getrandmax(). If you want a random number between 6 and 12 (inclusive), for example, use rand(6, 12).This function does not generate cryptographically safe values, and should not be used for cryptographic uses. If you want a cryptographically secure value, consider using openssl_random_pseudo_bytes() instead. Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
What is mean by an associative Array in PHP?
|
View Answer
|
|
What is the importance of "method" attribute in a html form?
|
View Answer
|
|
What is the importance of "action" attribute in a html form?
|
View Answer
|
|
What is the use of "enctype" attribute in a html form?
|
View Answer
|
|
What is Object Orientation, in case of PHP?
|
View Answer
|
|
How do you define a Constant in PHP?
|
View Answer
|
|
How send Email using PHP?
|
View Answer
|
|
How to find Current Date and Time in PHP?
|
View Answer
|
|
Difference between mysql_connect and mysql_pconnect in PHP?
|
View Answer
|
|
What is the use of "ksort" in PHP?
|
View Answer
|
|
What is the difference between $var and $$var?
|
View Answer
|
|
What are the encryption techniques in PHP?
|
View Answer
|
|
What htmlentities() does in PHP?
|
View Answer
|
|
How to delete a file from the system in PHP?
|
View Answer
|
|
How to get the value of Current Session Id in PHP?
|
View Answer
|
|
What are the different types of errors in PHP ?
|
View Answer
|
|
What is SQL Injection ?
|
View Answer
|
|
What is x+ mode in fopen() used for, in case of PHP?
|
View Answer
|
|
What is PEAR in case of PHP?
|
View Answer
|
|
Distinguish between urlencode and urldecode in PHP?
|
View Answer
|