PHP gmp_or() function17 Mar 2025 | 3 min read PHP GMP gives logical function called gmp_or() with parameter. The gmp_or() function uses to display a bitwise OR comparison between two numbers. This function uses for logical operation. SyntaxThe following syntax shows the GMP bitwise OR function. ParameterThe syntax shows two source parameters for the "OR" operation. The two parameters are numerical values. Return ValueThis function gives an exclusive OR value of the two numerical data. It is the bitwise comparison of the numerical value as an output. ExamplesThe following examples show the "OR" function using the GMP parameters. Example1: the following example shows basic bitwise "or" functions with value. the function uses a basic value as a parameter. Output: The following output shows bitwise the "OR" comparison value. ![]() Example2: the following example shows a comparison of the two values using the "OR" operator. The parameter uses negative values to get a bitwise "OR" operation. Output: The following output shows the "OR" comparison value. ![]() Example3: the following example shows a comparison of the two values using the "OR" operator. This function uses a variable with the "OR" function. Output: The following output shows the "OR" comparison value. ![]() Example4: the following example shows the bitwise operation of the two values using the "OR" operator. This function uses a variable, another GMP function with the "gmp_OR" function. Output: The following output shows the "OR" comparison value. ![]() Example5: the following example shows the "gmp_or" with the "gmp_init" function. Output: The following output shows the "OR" comparison value. ![]() ConclusionThe "gmp_or()" function uses to compare two parameters with bitwise OR operation. It is the logical operation with numerical GMP parameters. Next TopicPHP gmp_divexact() Function |
It is similar as include but it includes external file only one time. First, it will check whether the specified file is already included or not. If the file is not included then it only includes an external file. Example 1 Save as page1.php Save as page2.php Output: Example 2 Change the...
1 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
The addition operation uses in the application without mathematical operators and functionalities. PHP has a built-in function called gmp_add() that uses for the addition of the two figures. Here, we can use positive and negative numbers using a simple function. Syntax The following syntax shows the GMP addition's...
2 min read
PHP try and catch are the blocks with the feature of exception handling, which contain the code to handle exceptions. They play an important role in exception handling. There is one more important keyword used with the try-catch block is throw. The throw is a keyword...
5 min read
PHP has a built-in function called GMP export() that turns a GMP number into a binary string. Syntax The given syntax shows the PHP GMP export function. string gmp_export (GMP $numbers, int $num_size, int $option_nums); Parameters As shown above syntax and explained below, the GMP gmp_export() function takes three parameters: $numbers: This...
3 min read
PHP type casting helps the developer to easily convert one type of value to another, or a given PHP class object can also be converted to object of a different class. Program 1: PHP type casting to an integer <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> ...
5 min read
PHP is a popular open-source scripting language for web development that can be included in HTML. It is an abbreviation that is recursive and stands for "Hypertext Preprocessor". It is a useful tool for making interactive websites. PHP scripts utilize servers to handle client requests....
4 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
How to create newline in PHP? To create a newline, PHP provides nl2br() function. It is an in-built function of PHP, which is used to insert the HTML line breaks before all newlines in the string. Although, we can also use PHP newline character \n or \r\n...
2 min read
In this article, we will understand about a with the help of various examples. What do you mean by Ternary operator? It is also called a conditional operator. The ternary operator is an operator that decreases the length of code while performing comparisons. It is an alternative...
4 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