Php program to print the number using post-increment operator

A Php program to print the number using post-increment operator. In this program we can print the output using post increment operator. The term “post-increment” refers to the process of increasing a number. The value of the variable is increased after it has been assigned to it.

<?php
$x = 10;
echo $x++;
?>

 

Output:

10

What is post increment operator in php

The post-increment operator is used to increase the value of a variable after the expression has been entirely executed. Value is first employed in an expression and then incremented in the Post-Increment.

After the expression containing the variable to be increased has been evaluated, an increment operation occurs. To carry out a surgery like this on. After utilising a variable in an expression, the post increment operator is used to increase its value. The value is used inside the expression and then incremented by one in the post increment.