Can someone explain this code :<?php  $a = 5; $a = $a + 1; echo $a; ?>The output is 6,How?what did save in RAM?$a = 5 or $a = $a + 1 ?
How does $a = 5; $a = $a + 1 ; equal 6?
php
$a is a variable.  It should be obvious from the name alone that its value can vary.The PHP interpreter treats variables as symbols, so the logic goes like this:$a = 5;      // set the value of the variable symbol $a to 5$a = $a + 1; // set the value of the variable symbol $a to the value of $a, plus 1echo $a;     // write out the value of $aThe thing that's happening in the 2nd line is that it's using the value of $a in its calculation, and assigning the result of the calculation back to $a, replacing the value that was in there before.As Robert Harvey alluded to with the link he posted, research indicates that this is a fundamentally confusing concept to some people; their brains are just not wired the right way for the sort of symbolic thought that programming uses all the time.  If this idea of reassigning values just doesn't make any sense, you'd probably save yourself a lot of frustration and wasted time by looking elsewhere for a career.  On the other hand, if my explanation managed to clear it up, then by all means, keep learning. :)