php内部筆記試験問題
5348 ワード
1. nginx ?
2. echo 'hello tusheng' ; ?> , , ( : )
3. , , ?
4. : $str = "1109063 milo 1";
1109063 $uid, milo $user, 1 $type
5. TINYINT SMALLINT MEDIUMINT INT
6. i am milo! day day up!
7. count
8. session ,
9. HTTP ,
200, 301, 404, 502, 503
10. , mysql user
host: 192.168.0.254
port: 3306
user: one
pass: piece
database: db_user
table: user
11. autoload($class) Lib
12. set_error_handle ,
set_error_handle(callback,level)
function callback(int $errno , string $errstr [, string $errfile [, int $errline [, array $errcontext ]]] ){
}
13. php notice
14. instanceof ,
15. 1023 ,
16. php ? ?
17. include require
18. , ( 5 50 ),
: php
: func_num_args() func_get_arg() unc_get_args()
19. ( return ) , , (global &)
20. user 10 , , sql order by
user uid, username
21. sql uid , uid , uid in
select uid from user where uid in(10, 1, 3, 8, 11, 4, 7);
22. PHP **
23. 2.php ? ? 1.php->2.php
1.php
2.php
24. php json , json
25. mysql sql ' / , sql
26. php header
27. , 2.php
1.php
2.php
';
$r2 = include_once "1.php";
echo $r2;
?>
28. call_user_func
29. nginx server_name www.120.net xxx.120.net
http://www.120.net/index.php http://xxx.120.net/index.php
$_SERVER["SERVER_NAME"] $_SERVER["REQUEST_URI"]
30. linux drwxr-xr-x
31. 1Mbps KBps,
1. +
2. , ? ?
3.
4.
threads
posts
threads tid
posts pid, tid
tid threads posts
posts 1 , threads 2000 , 5
, posts threads mysql
5. mysql / , php mysql php ?
6. UCenter
7. linux http://www.120.net/test-1.0.0.tar.gz
a. /usr/local/src
b. /usr/local/test
c. mysql , /usr/local/mysql
8. php memcache ( )
a. mysql , memcache
b. mysql , mysql , memcache
9. ,
10. arrayaccess
ArrayAccess {
/* Methods */
abstract public boolean offsetExists ( string $offset )
abstract public mixed offsetGet ( string $offset )
abstract public void offsetSet ( string $offset , string $value )
abstract public void offsetUnset ( string $offset )
}
11. coreseek /usr/local/coreseek
/usr/local/coreseek/etc/test.conf
post
a.
b.
c. ( )
12. posts sphinx ,
13. php :
$i = 97;
$a = ($i++) + (++$i) + $i ;
$b = (--$i) + ($i--) + $i + 6;
echo "$i, $a, $b";
?
14. , IP:
if(getenv('HTTP_CLIENT_IP') && strcasecmp(getenv('HTTP_CLIENT_IP'), 'unknown')) {
$onlineip = getenv('HTTP_CLIENT_IP');
} elseif(getenv('HTTP_X_FORWARDED_FOR') && strcasecmp(getenv('HTTP_X_FORWARDED_FOR'), 'unknown')) {
$onlineip = getenv('HTTP_X_FORWARDED_FOR');
} elseif(getenv('REMOTE_ADDR') && strcasecmp(getenv('REMOTE_ADDR'), 'unknown')) {
$onlineip = getenv('REMOTE_ADDR');
} elseif(isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], 'unknown')) {
$onlineip = $_SERVER['REMOTE_ADDR'];
}
HTTP_ header , , PHP HTTP_CLIENT_IP, HTTP_X_FORWARDED_FOR ?
15. google,baidu , ( PC ) URL , , ? , 。
16. php.ini magic_quotes_gpc magic_quotes_runtime ?
17. PHP http file_get_contents, , PHP , , ,PHP ?
18. , DNS ?
19. mysql set names * ?()
A、Character_set_client B、Character_set_system
C、Character_set_results D、Character_set_server
E、Character_set_connection F、Character_set_database
20. ?()
A、utf8_general_ci B、utf8_general_cs C、utf8_general_bin
21. XSS ?
23. CSRF ?