PHP gmp_xor() function17 Mar 2025 | 4 min read PHP 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. |
PHP is one of the most popular server-side programming languages for web and API developers. It is used to create web applications, websites, and more. It fetches the new functionalities, features and improvements through new PHP versions to accomplish the user’s needs and plays a...
6 min read
PHP PHP print_r() is a built-in function that displays information about a variable in a human-readable way. It shows the information stored in a variable, which is easily understandable to the user. There are two more functions similar to print_r() which are var_export(), and var_dump(). They display...
2 min read
While working with PHP, many times the developer requires converting the array data into string so they can easily implement the String functions to the data. In this tutorial, we will briefly discover the various ways of converting Array into String in PHP. PHP provides different inbuilt...
3 min read
MVC is a software architectural pattern for implementing user interfaces on computers. It divides a given application into three interconnected parts. This is done to separate internal representations of information from the ways information is presented to, and accepted from the user. MVC stands for "Model view...
2 min read
is a range of crucial instruments that make it simple to have at nearby servers so you can create or fabricate Web Applications on your PC. In the event that you are making improvement on the web application, having a is a wonderful way,...
7 min read
PHP empty ( ) Function The empty() function is an inbuilt function in PHP, which is utilized to check regardless of whether a variable is unfilled or not. Syntax bool empty ( $ variable name ) Parameters: This function acknowledges a solitary parameter as displayed in above syntax and portrayed...
4 min read
PHP array_chunk() Function The array_chunk() function is built-in function in PHP. The array_chunk function splits an array into chunks of new arrays. This function divides an array into different block of new arrays. Syntax array_chunk(array,size,preserve_key); Parameter Description Is compulsory array Specifies the array to use compulsory size Integer that specifies the size of each chunk compulsory preserve key When...
2 min read
Any pixel that matches the target and is an immediate neighbor has its color value changed. This function is a replacement for Imagick::paintFloodFillImage, which has been deprecated (). If Imagick has been compiled against ImageMagick version 6.3.8 or newer, this approach is accessible. Parameters Fill A string containing the...
3 min read
PHP language has developed a function called gmp_root() that delivers the integer value of the N-th root of a given parameter or number. Syntax The syntax shows the GMP function to get a root value of the base parameter. <?php gmp_root($base_value, $n_value); ?> Parameters The function takes two variables: a $base value and...
3 min read
Imagecharup( ) function is another inbuilt PHP function that is mainly used to draw characters vertically. The function works using the x and y-axis, which are used to set coordinates for the starting point from where the picture has to be drawn. The origin coordinates (0,...
7 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India