Javatpoint Logo
Javatpoint Logo

PHP gmp_import() Function

The PHP GMP import function converts string values into a binary value. We can operate the mathematical function of string data using the gmp_import() function.

Syntax

The following syntax shows the PHP GMP import function.

Parameters

As shown above syntax and explained below, the GMP gmp_import() function takes three parameters:

  1. $numbers: This is a essential parameter for the GMP gmp_import() function. It is the number that the function will import from the string value.
  2. $num_size: This parameter shows how many bytes are in each piece of binary data. Sometime, the main parameter works with the options parameter. This parameter's default value is one (1).
  3. $option_num: GMP MSW FIRST | GMP NATIVE INDIAN is what this parameter is set to by default.

Return Values

If the function works, a string is returned. If it doesn't work, FALSE is returned.

Examples

The following example shows the multiple types of import function operations using different data.

Example1: the following example shows gmp_import() function with basic value. The given parameter shows import values of the negative and positive numbers.

Output:

The following output shows the gmp_import() function and its data.

PHP gmp_import() Function

Example2: the following example shows a value with the variable value.

Output:

The following output shows the gmp_import() function and its data.

PHP gmp_import() Function

Example3: the import function uses number count with a basic GMP parameter. We can see the difference between default word count and user word count.

Output:

The following output shows the gmp_import() function and its data.

PHP gmp_import() Function

Example4: the following example shows a value with the string variable value. Here, we use capital string data to convert it into binary numbers.

Output:

The following output shows the gmp_import() function and its data.

PHP gmp_import() Function

Example5: the following example shows a value with the string variable value. Here, we use lowercase string data to convert it into a binary number.

Output:

The following output shows the gmp_import() function and its data.

PHP gmp_import() Function

Example6: the following example shows a value with the string variable value. Here, we use different string data to convert them into binary numbers. The example uses the same string letters with different letters and different data.

Output:

The following output shows the gmp_import() function and its data.

PHP gmp_import() Function

Example7: the following example shows a value with the string variable value. Here, we use lowercase string data to convert it into a binary number. The addition and division operation work with binary values.

Output:

The following output shows the gmp_import() function and its data.

PHP gmp_import() Function

Conclusion

The division "gmp_import ()" function uses the GMP parameter for conversion operation. It gets the binary value or number of the given string parameters. The function removes complicated and large-size conversion operations code using function and values.







Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA