Hello
++$my_information means it can be Increments $my_information by one, then returns $my_information.
$my_information++ means it can be
--$my_information means it can be Decrements $my_information by one, then returns $my_information.
$my_information-- means it can be
Try this code you can understand that.
<
$my_information = 5;
$my_information = 5;
$my_information = 5;
$my_information = 5;
?>
Postincrement
Should be 5: 5Should be 6: 6
Preincrement
Should be 6: 6Should be 6: 6
Postdecrement
Should be 5: 5Should be 4: 4
Predecrement
Should be 4: 4Should be 4: 4
Try another example
<? php
$my_bat = 6;
for ($i = 0; $i < 6; ++$i)
{
echo 'I have '. $my_bat-- . " Bats. I just ate one.\n";}?
>
?>
I have 6 Bats.
I have 5 Bats.
I have 4 Bats.
I have 3 Bats.
I have 2 Bats.
I have 1 Bats.
0 komentar:
Post a Comment