-->

  • PHP random numbers


    PHP random numbers



    PHP Random Numbers


    The rand() function is used in PHP to generate a random integer. The rand() PHP function can also be used to generate a random number within a specific range, such as a number between 10 and 35.

    If no max limit is specified when using the rand() PHP function, the largest integer that can be returned is determined by the getrandmax() function, which varies by operating system.  PHP random numbers



    Random Number Syntax :

    rand();

    or

    rand(min, max);


    Random Numbers :

    The rand() funciton generates a random number:


    Example 


    echo (rand(10,35));

    echo "<br>";

    echo (rand(1, 100000));

    echo "<br>";

    echo (rand());


    ?>



    </body>
    </html>



    As you can see in these examples, the first rand function generates a random number between 10 and 30, the second between 1 and 1 million, and then third without any maximum or minimum number defined.




    11
    18804
    367545283







    Video on This Topic :- Soon




    I hope you liked this post, then you should not forget to share this post at all.

    Thank you so much :-)


  • 0 comments:

    Post a Comment

    For Any Tech Updates, Hacking News, Internet, Computer, Technology and related to IT Field Articles Follow Our Blog.