Junior PHP Developer Question:

Download Job Interview Questions and Answers PDF

Do you know what is the use of rand() in php?

Junior PHP Developer Interview Question
Junior PHP Developer Interview Question

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.

Download Junior PHP Developer Interview Questions And Answers PDF

Previous QuestionNext Question
Tell me what is the use of mysql_real_escape_string() function?Tell us how to create an array of a group of items inside an HTML form?