PHP gmp_xor() functionPHP language provides mathematical or logical GMP function called gmp_xor() with essential parameter. The gmp_xor() function works to calculate a bitwise XOR comparison or value between two numbers. The function works for logical operation for two numerical input values. SyntaxThe syntax shows how to operate the GMP bitwise XOR function. Parameters
Return ValueThis function gives an XOR value of the two values. It is the XOR comparison number of the input value as an output. ExamplesThe examples show the "XOR" calculation using the two GMP parameters in a function. Example1: the given an example calculates bitwise "XOR" function with given value. The function uses a basic numeric value as a parameter. Output: The following output shows bitwise "XOR" comparison value. Example2: the following example compares the two values using the "XOR" operator. The input parameter uses negative numbers to get a bitwise "XOR" operation. Output: The following output shows bitwise "XOR" comparison value. Example3: the following example compares the two values using the "XOR" operator. The input data uses various variables as parameters with the "XOR" function. Output: The following output shows bitwise "XOR" comparison value. Example4: the following example shows the bitwise operation of the two values using the "XOR" operator. This function uses a variable, another GMP function with the "gmp_xor" function. Output: The following output shows bitwise "XOR" comparison value. Example5: the following example shows the "gmp_xor" with the "gmp_init" function. Here, we use binary data as input parameters. Output: The following output shows bitwise "XOR" comparison value. Example6: the following example shows the "gmp_xor" with the other GMP function. Here, we use string values as input parameters. Output: The following output shows bitwise "XOR" comparison value. ConclusionThe "gmp_xor()" function compares two parameters with bitwise XOR operation. It is a logical operation with numeric GMP parameters. |