Javatpoint Logo
Javatpoint Logo

PHP gmp_and()Functions

PHP has a built-in logical function called gmp_and() or gmp_or(). The gmp_and() function uses to display bitwise AND comparison between two values. This function uses for logical operation using two parameters.

Syntax

The following syntax shows the GMP bitwise AND functions.

Parameter:

  • The syntax shows two source parameters for the "AND" operation.
  • The two parameters must be numerical.

Return Value:

This function gives an exclusive AND value of the two numerical data. It is a bitwise comparison of numerical value as an output.

Examples

The following examples show the "AND" function using the GMP parameters.

Example1: the following example shows basic bitwise "and" functions with value. the function uses a basic value as a parameter.

Output:

The following output shows bitwise the "AND" comparison value.

PHP gmp_and()Functions

Example2: the following example shows a comparison of the two values using the "AND" operator. The parameter uses negative values to get the bitwise "AND" operation.

Output:

The following output shows the "AND" comparison value.

PHP gmp_and()Functions

Example3: the following example shows a comparison of the two values using the "AND" operator. This function uses a variable with the "AND" function.

Output:

The following output shows the "AND" comparison value.

PHP gmp_and()Functions

Example4: the following example shows the bitwise operation of the two values using the "AND" operator. This function uses variable, other GMP functions with the "gmp_and" function.

Output:

The following output shows the "AND" comparison value.

PHP gmp_and()Functions

Example5: the following example shows the "gmp_and" with the "gmp_init" function.

Output:

The following output shows the "AND" comparison value.

PHP gmp_and()Functions

Conclusion

The "gmp_and()" function uses to compare two parameters with bitwise AND operation. It is the logical operation with numerical GMP parameters.







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