PHP gmp_random_range() functionThe PHP gmp_random_range() function creates a random number between the given two input GMP numbers. This function works between the minimum and maximum numbers. It works on a positive and negative input value. SyntaxThe syntax shows the GMP function to get a random range between two numbers. Parameters
Return ValueThe function shows an output in number format to give a random range of the two values. ExamplesThe given examples show the random value of the various GMP parameters. Example1: the given example shows "random values" of the two input positive values. Output: The following output identifies the random values of the given values. Example2: the following example shows "random values" of the given negative and positive two input values. Here, we cannot use negative for the maximum number's parameter. The maximum parameter position is greater than the minimum parameter's position. Output: The following output identifies the random values of the given values. PHP gmp_random_range() Function Display random values of the given input data The random value of a given numbers: 58 The random value of the given numbers: -27 The random value of the given numbers: The random value of the given numbers: -25 Example3: the given example shows "random values" of the variable values. Output: The following output identifies the random values of the given values. Example4: the given example shows "random values" with the GMP parameters or values. Output: The following output identifies the random values of the given values. Example5: the given example shows "random values" with the binary GMP parameters or values. Output: The following output identifies the random values of the given values. ConclusionThe random value between two numbers or range is found using the gmp_random_range function. It is easy to operate on two values in mathematical operations using this function. Next TopicPHP gmp_root() function |