How to increment variable value by 1 in php

Updated at 16-Aug-2021, By samar

How to increment variable value by 1 in php

Good day, guys. In this post, we’ll look at how to solve the "How to increment variable value by 1 in php" programming puzzle.

You can use the ++ operator after the variable to increment the variable value by 1;
  • Php increment variable by 1

    <?php
    $id = 2;
    $id++;  
    echo $id;
    

Back to code snippet queries related php