Re: omit's comment
The note omit quotes is referring to the VALUE returned, not its name. If you put 42 into a text field, the corresponding array value will be the string "42". The note makes no comment on the array's keys.
附录 Q. PHP 类型比较表以下的表格显示了 PHP 类型和比较运算符在松散和严格比较时的作用。该补充材料还和类型戏法的相关章节内容有关。同时,大量的用户注释和 BlueShoes 的工作也给该材料提供了帮助。 在使用这些表格之前,需要明白变量类型及它们的意义。例如,"42" 是一个字符串而 42 是一个整数。FALSE 是一个布尔值而 "false" 是一个字符串。
表 Q-1. 用 PHP 函数对
表 Q-2. 用 == 进行松散比较
表 Q-3. 用 === 进行严格比较
15-Mar-2007 10:06
Re: omit's comment
omit
23-Aug-2006 06:32
the manual said "HTML Forms do not pass integers, floats, or booleans; they pass strings"
Jan
29-Dec-2005 07:23
Note that php comparison is not transitive:
php [at] barryhunter [.] co [.] uk
07-Sep-2005 07:44
In case it helps someone, here's a table to compare different Variable tests (created before I found this page!)
jerryschwartz at comfortable dot com
26-Jul-2005 08:04
In some languages, a boolean is promoted to an integer (with a value of 1 or -1, typically) if used in an expression with an integer. I found that PHP has it both ways:
tom
17-Jun-2005 09:27
<?php
aidan at php dot net
24-Jan-2005 03:00
The way PHP handles comparisons when multiple types are concerned is quite confusing. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||