0
Php
Say me this answer $a=2; $b=$a++; When I am executing it i am getting it as 2 but how.$a is incremented and assigned to $b know then I should get the value as 3 know but how give me explaination
1 Answer
0
to get 3 as result, $b=++$a
$a++ is post increment, return $a then increment by 1
++$a is pre increment, increment by 1 then return $a