- 相關(guān)推薦
PHP面試題與答案
1. 禁用COOKIE 后 SEESION 還能用嗎?
2. 抓取遠(yuǎn)程圖片到本地,你會(huì)用什么函數(shù)?
4. 你覺(jué)得在pV10W的時(shí)候, 同等配置下,LUNIX 比WIN快多少?
5. 簡(jiǎn)述pOST 和GET傳輸?shù)淖畲笕萘糠謩e是多少?
6. 用最少的代碼寫一個(gè)求3值最大值的函數(shù).
以下是部分答案(不保證是正確的解)
1. 不能
2 fsockopen
4 (不做優(yōu)化的情況下一樣)
5 2MB,1024B
6 function($a,$b,$c){
return $a>$b? ($a>$c? $a : $c) : ($b>$c? $b : $c );
}
———————————————————————————–
大公司的pHp面試題
2. 求兩個(gè)日期的差數(shù),例如2007-2-5 ~ 2007-3-6 的日期差數(shù)
$begin=strtotime(‘2007-2-5′);
$end=strtotime(‘2007-3-6′);
echo ($end-$begin)/(24*3600);
3. 請(qǐng)寫一個(gè)函數(shù),實(shí)現(xiàn)以下功能:
字符串“open_door” 轉(zhuǎn)換成 “OpenDoor”、”make_by_id” 轉(zhuǎn)換成 ”MakeById”。
function str_change($str) {
$str = str_replace ( “_”, ” “, $str );
$str = ucwords ( $str );
$str = str_replace ( ” “, “”, $str );
return $str; }
4. 要求寫一段程序,實(shí)現(xiàn)以下數(shù)組$arr1轉(zhuǎn)換成數(shù)組$arr2:
$arr1 = array (
‘0′ => array (‘fid’ => 1, ‘tid’ => 1, ‘name’ =>’Name1′ ),
‘1′ => array (‘fid’ => 1, ‘tid’ => 2 , ‘name’ =>’Name2′ ),
‘2′ => array (‘fid’ => 1, ‘tid’ => 5 , ‘name’ =>’Name3′ ),
‘3′ => array (‘fid’ => 1, ‘tid’ => 7 , ‘name’ =>’Name4′ ),
‘4′ => array (‘fid’ => 3, ‘tid’ => 9, ‘name’ =>’Name5′ )
);
$arr2 = array (
‘0′ => array (
‘0′ => array ( ‘tid’ => 1, ‘name’ => ‘Name1′),
‘1′ => array ( ‘tid’ => 2, ‘name’ => ‘Name2′),
‘2′ => array ( ‘tid’ => 5, ‘name’ => ‘Name3′),
‘
【PHP面試題與答案】相關(guān)文章:
PHP面試題10-14
PHP的面試題集推薦08-02
java面試題及答案10-03
Web前端面試題目及答案06-30
php職業(yè)規(guī)劃范文09-03
Microsoft面試題09-04
iOS面試題07-10
公司面試題09-12
hibernate面試題10-18
英語(yǔ)面試題精選06-13