1.
$a = 3;
$b = 2;
echo (int)$a/(int)$b为什么输出是 1.5?
2.
How can you hide the fact that web pages are written in PHP?
a. By using AddType application/X-httpd-php asp
b. Specify all file names without any dot and extension
c. By using .htaccess diretive in Apeche
d. All of the above3.
解释一下Using Register Globals。
所以 (int)$a/(int)$b = 3 / 2 = 1.52. 我选择d3. Using Register Globals的场合,提交的变量可以直接通过 $变量名 使用。
但是存在安全问题,建议不要用Register Globals.
(int)($a/$b);如此结果是1
2 事实上这些措施还不够,最好能重编译apache,改写web服务器输出头,隐藏开发语言是php的信息3 是已经非常不推荐的功能了
两个整数相除就是浮点数,跟C有点不一样,只有整除的时候才会返回整数,PHP手册里特意说过的。http://jm2.php.net/manual/zh/language.operators.arithmetic.php
除法运算符总是返回浮点数。只有在下列情况例外:两个操作数都是整数(或字符串转换成的整数)并且正好能整除,这时它返回一个整数。
X-Power-By: PHP
这个跟PHP有关,但是这个只需要配置一下php.ini就可以了。
expose_php = off
是的,但不重新编译,Server: Apache去不掉,也不能改我的意思,可以重编译将apache伪装成别的web服务器……然后将默认配置PHPSESSID也改了……
数据类型
根源还是在于php转换数据类型太容易了,hoho强类型的语言,一般都会以a、b当中,精度更高的作为结果返回