note 36922 added to control-structures.switch
| From: | elpargo0 at hotmail dot comSPAM | Date: | Mon, 27 Oct 2003 14:11:06 +0000 |
| Subject: | note 36922 added to control-structures.switch | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-59376@lists.php.net to get a copy of this message | ||
in answer to
Maktub
The code you posted is suposed to work that way. why?
#1 as if a variable containing a string REPRESENTS a number then the variable becomes an string so
$var= "4"; is the same as
$var='4'; and also the same as
var = 4;
in other languajes where programmers have to specify the type of the variable like C++ the 1st is a
string the second a character and the last one a number aka integer.
#2 so since what u have is one variable with the value +3 and one with the value 3 ...
from math u know that they r the same so the code actually works.
I hope this helps :)
----
Manual Page -- http://www.php.net/manual/en/control-structures.switch.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+36922
Delete -- http://master.php.net/manage/user-notes.php?action=delete+36922&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+36922&report=yes
Search -- http://master.php.net/manage/user-notes.php