PHP程序员站--PHP编程开发平台
 当前位置:主页 >> PHP基础 >> 基础文章 >> 

12道PHP类型检测题目

12道PHP类型检测题目

来源:PHP程序员站  作者:PHP程序员站  发布时间:2011-03-06
这些题目无意之中在一个网站上找到,先做做看,你能对几道?过几天再把答案公布出来! PHP Skills Test $a .= a; $a .= b; $a .= c; What is the value of $a ? $a = 4; for ($b = 0; $b = $a; $b++) { $c++; } What is the value of $c ? $a[] = a; $a[] = b; $a[] =

这些题目无意之中在一个网站上找到,先做做看,你能对几道?过几天再把答案公布出来!

PHP Skills Test
 

$a .= "a";
$a .= "b";
$a .= "c";

What is the value of $a ?

 


$a = 4;
for ($b = 0; $b <= $a; $b++) {
$c++;
}

What is the value of $c ?

 
 

$a[] = "a";
$a[] = "b";
$a[] = "c";

What is the value of $a[2] ?

 
 

$a = 200.5;
$b = 2005;
$c = "2005";

Which of the above variables's type is integrer ?
$
 
 

$a = '1';
$b = &$a;
$b = "2$a";

What is the value of $a ?

 
 

$a = "abc";
$b = substr($a, 0, -1);

What is the value of $b ?

 
 

$a = true;
$b = "true";
$c[] = "true";

Which of the above variables's type is string ?
$
 
 

$a = "b";
$b = "a";

What is the value of ${$b} ?

 
 

$a = array("a","b","c");
foreach ($a as $b){
$c++;
}

What is the value of $c ?

 
 

$a = "0";
$b = "0";
if ($a != "1" && $b == "1" || $a != "0" || $b != "1" ){
$d = "0";
}else{
$d = "1";
}

What is the value of $d ?

 
 

$a = "post_processed_string";
$b = array("post_", "_");
$c = array("", " ");
$d = ucwords(str_replace($b,$c,$a));

What is the value of $d ?

 
 

$a = "<tt>some</tt><b>html</b>";
preg_match("/<\w?>(\w*?)<\/\w?>/",$a,$b);

What is the value of $b[1] ?

 


延伸阅读:
一份村官面试题
腾讯PHP工程师笔试题
从 PHP 一道测试题说起
微软和IBM经典面试笔试题N则
某公司一份英文php面试题(E文好的一定要看了)
变态IQ面试题
PHP高级工程师的面试题
VeryCD网站开发PHP程序员基础面试题
北京某信息技术公司的php面试题
新浪php工程师面试题
一道关于php变量引用的面试题


一道求$b相对于$a的相对路径的php面试题
一道腾讯php面试题
一道金山笔试题
某公司的php面试题
php面试题N则
Tags: php   类型检测   笔试题  
最新文章
推荐阅读
月点击排行榜
PHP程序员站 Copyright © 2007-2010,PHPERZ.COM All Rights Reserved 粤ICP备07503606号