Number in Reverse Order in PHP. By using this program we can print the number in reverse using php mod. The modulo operator is an arithmetic operator denoted by percent. The remainder of an integer division is produced by the modulo division operator. When x is divided by y and both x and y are integers, the equation x percent y. provides the residual.

<!DOCTYPE html>

<html>

<body>

<?php

$num = 4973489;

$x = 0;

$n =$num;

while(floor($num))

{

$mod = $num%10;

$x = $x * 10 + $mod;

$num = $num/10;

}

echo "Reverse of $n is $x.";

?>

</body>

</html>

Output:

Reverse of 4973489 is 9843794.

## Floor in Php

Another built-in function in PHP iterpreter is the floor() function. Any float number can be passed as an argument, and it will be rounded down to the next lowest integer. Because the range of float is larger than that of integer, this function always returns a float number.

Only one parameter is required for both ceil() and floor(): the number to round. Ceil() rounds the number to the next integer higher than its current value, whereas floor() rounds it to the nearest integer lower than its current value. Round() will always round up a number that is exactly half way between two integers.

## While Loop and How to Execute

The while construct is made up of a code block and a condition/expression. This process is repeated until the condition/expression is no longer true. The control structure is sometimes known as a pre-test loop since the while loop examines the condition/expression before executing the block.

Display Identifier in C# With Example

How to Display Float Value in C#

C# Sharp Programming Examples Sample Problems with Output

Digital Marketing Interview Questions for Freshers

Python Interview Questions and Answers for Freshers

Change Value After Declaration in C#

How to Concatenate Two Strings in C#

How to Add Multiple Values to String in C#