πŸ“Š PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
$p = 12;
echo ++$p;
echo $p++;
echo $p;
echo ++$p;
?>
  • (A) Error
  • (B) 12
  • (C) Nothing
  • (D) 13131415
πŸ’¬ Discuss
βœ… Correct Answer: (D) 13131415

Explanation: ++$p increments a and then prints it,$p++ prints and then increments.

Explanation by: Parvesh Kanani
++$p increments a and then prints it,$p++ prints and then increments.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
204
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Parvesh Kanani
Publisher
πŸ“ˆ
95%
Success Rate