Search the Community
Showing results for tags 'increment'.
-
<?php $i = 2; $i = $i++; echo $i; ?> Output of above code is 2. <?php $i = 2; $p = $i++; echo $i; ?> Output of above code is 3. Why this difference? I mean how these codes are processed to give an output?
-
Hi there, so I'm having a little trouble understanding looping and arrays or inputs. I'm a Pshell programmer and things are done MUCH differently lol So heres the script I've created. <?php $first=400; $second=300; for ($i = $first; $second < $i; $i++) { echo $i; } ?> What I'm trying to accomplish is taking the first Number and the second and get it to count or "loop" up to 400 from the lower number. Then have it output the result. I'm not sure what I'm doing wrong here though......