Examveda
Examveda

What will be the output of the following PHP code ?
<?php
$a = 10;
echo ++$a;
echo $a++;
echo $a;
echo ++$a;
?>

A. 11111213

B. 11121213

C. 11111212

D. 11111112

Answer: Option A

Solution(By Examveda Team)

++$a increments a and then prints it,$a++ prints and then increments.

This Question Belongs to PHP >> Operators And Expressions In Php

Join The Discussion

Related Questions on Operators and Expressions in php