Daniel Good, PHP novice ask a few face questions
PHP Code
1. $a = 3; $b = 2;echo (int) $a/(int) $b Why is the output 1.5? 2.How can you hide the fact that Web pages is written in Php?a. By using AddType application/x-httpd-php ASPB. Specify all file names without any dot and extensionc. By using the. htaccess diretive in apeched. All of the above3. Explain the using Register Globals.
------Solution--------------------
1. Because 1)/is the division operator, not the divisible operator 2) (int) operator precedence is higher than/
SO (int) $a/(int) $b = 3/2 = 1.5
2. I choose D
3. Using the Register globals, the submitted variable can be used directly through the $ variable name.
However, there is a security problem, it is recommended not to use register Globals.
------Solution--------------------
(int) Acting on a variable, not an entire expression
(int) ($a/$b); So the result is 1.
2 In fact, these measures are not enough, it is better to recompile Apache, rewrite the Web server output header, hide the development language is PHP information
3 is a very deprecated feature.
------Solution--------------------
Upstairs two people
in C (int) A/(int) b but equal to 1 OH
This problem is from here.
The test center is the automatic transformation of the data type, and the result of dividing two integers is the floating-point number.
------Solution--------------------
discuss
Upstairs two people
in C (int) A/(int) b but equal to 1 OH
This problem is from here.
The test center is the automatic transformation of the data type, and the result of dividing two integers is the floating-point number.
------Solution--------------------
Explore
2 In fact, these measures are not enough, it is better to recompile Apache, rewrite the Web server output header, hide the development language is PHP information
------Solution--------------------
It's like talking about a place where there's no point. Or there's no need to do that.
Data type
The source is still the PHP conversion data type is too easy, HoHo
Strong type of language, usually in a, b, higher precision as a result of the return