• PHP Video Tutorials

PHP - gmp_or() Function



Definition and Usage

The gmp_or() function calculates the bitwise OR of the given numbers.

Description

The gmp_or() calculates the bitwise OR for the given two GMP numbers.

Syntax

gmp_or ( GMP $a , GMP $b ) : GMP

Parameters

Sr.No Parameter & Description
1

a

It can a GMP resource number , a gmp object or a numeric string.

2

b

It can a GMP resource number , a gmp object or a numeric string.

Return Values

PHP gmp_or() function returns GMP number.

PHP Version

This function will work from PHP Version greater than 5.0.0.

Example 1

Working of gmp_or() −

<?php
   $or1 = gmp_or("0xffeffcd", "16");
   $num1 =  gmp_strval($or1, 2);
   echo "The result is :".$num1;
?>

This will produce following result −

The result is :1111111111101111111111011101

Example 2

Working of gmp_or() −

<?php
   $or1 = gmp_or("0xffeffcd", "16");
   $num1 =  gmp_strval($or1, 8);
   echo "The result is :".$num1;
?>

This will produce following result −

The result is :1777577735
php_function_reference.htm
Advertisements