PHP gmp_random_seed() functionThe PHP GMP gmp_random_seed() function is used to set a random number generation (RNG) seed using the given GMP number. SyntaxThe syntax shows the GMP function to get a random number generation seed. Parameters
Return Value
ExamplesThe given examples show the RNG seed of the GMP parameter. We can use integer, numerical, binary, and string GMP data. Example1: the given example sets the "random number generate seed" of the positive input value. Here, we use the numerical value and text data in the example. Output: The following output sets the RNG values of the given values. Example2: the given example sets the "random number generate seed" of the input value. here we use the RNG value with the GMP the "gmp_random()", the "gmp_random_range()", and the "gmp_random_bits()" functions. Output: The following output sets the RNG values of the given values. Example3: the given an example sets the "random number generate seed" of the input value. Here, we use the numerical value and text data as input parameters. The GMP function is used for initializing data and working in the gmp_random_seed() function. Output: The following output sets the RNG values of the given values. Example4: the given an example sets the "random number generate seed" of the input value. We can see the difference between before and after using the function. Output: The following output sets the RNG values of the given values. Example5: the given an example sets the "random number generate seed" of the text value. Here, we uses the "gmp_random()" and the "gmp_random_bits()" function. Output: The following output sets the RNG values of the given values. Example6: the given an example sets the "random number generate seed" of the negative input value. Output: The following output sets the RNG values of the given values. ConclusionThe random_seed() function is used to set values for other GMP functions. This function is used for mathematical operations in a single line. Next TopicPHP gmp_scan0() function |