8、<?php
$foo = 'test';
$bar = <<<'EOT'
$foo bar
EOT;
echo $bar;
?>
上面的语句输出结果
(
):
A、 $foo bar; B、 'EOT' $foo bar EOT;
C、 test bar; D、 'EOT' test bar EOT;
9、定义常量的函数是( A )。
A、
define() B、constant() C、echo() D、count()
10、阅读下面 php 代码,并选择正确的输出结果()
<?php
define("PI",3.14);
$m = 100*PI;
echo $m;
?>
A、 314
B、 3.14 C、 0 D、 100
11、PHP 支持八种原始类型,其中下面哪个( C
)不属于四种标量类型。
A、 boolean(布尔型)
B、 integer(整型)
C、 array(数组)
D、 string(字符串)
12、PHP 中的变量用一个美元符号后面跟变量名来表示,那么下面变量名定义错误的是( C
)。
A、
$name123
B、
$_age
C、 $8n
D、 $_234
13、阅读下面 php 代码,并选择正确的输出结果(
A)。
<?php
$a = array("x"=>20,"y"=>30,40,2=>50,60);
echo $a[0].":".$a[1].":".$a[3];
?>
A、
40::60
B、 40:50:60
C、 40:60:
D、 40::
14、下面哪个函数是计算数组中的单元数目或对象中的属性个数( D)
A、 sum()
B、 array()
C、 strlen()
D、 count()
15、阅读下面 PHP 代码,并选择正确输出结果( B
):
<?php
$num="1,2,3,4";
2