第六章单元测试
  1. <?php
    $A = "PHPlinux";
    $B = "PHPLinux";
    $C = strstr($A,"L");
    $D = stristr($B,"l");
    echo $C ." is ".$D;
    ?>
    以下代码运行结果为( )。

  2. A:PHP is Linux B:PHP is
    C:is Linux D:PHP is inux
    答案:is Linux
  3. 下列哪个函数是将数组转换为字符串?( )

  4. A:imploed()
    B:explode()
    C:natsort()
    D:arsort()
  5. <?php
    $first = "This course is very easy !";
    $second = explode(" ",$first);
    $first = implode(",", $second);
    echo $first;
    ?>
    以下代码运行的结果为( )。

  6. A:This course is very easy !
    B:提示错误
    C:This course is very easy !,
    D:This,course,is,very,easy,!
  7. <?php
    $email='gaofeng@lampbrother.com.cn';
    $str = ____($email, '@');
    $info = ____('.',$str);
    ____($info);
    ?>
    输出结果为:Array ([0] => @lampbrother [1]=>com[2]=>cn)
    以上程序横线处应该使用的函数为( )。

  8. A:strchr, split, var,_dump
    B:strchr, split, var_dump
    C:strstr,explode, echo
    D:strstr, explode, print_r
  9. PHP中,下列哪个函数是将字符串前后颠倒?( )

  10. A:strfirst()
    B:strrpos()
    C:strstr()
    D:strrev()
  11. <?php
    $text = " \tllo ";
    echo strlen(trim($text));
    ?>
    以上字符的长度是( )。

  12. A:9
    B:5
    C:7
    D:3
  13. 将字符串中所有英文单字的开头字母转换为大写的函数应该是( )。

  14. A:ucwords()
    B:strtolower()
    C:strtoupper()
    D:ucfirst()
  15. 在PHP中,'+'操作符的功能不包括( )。

  16. A:类型自动转换
    B:变量数据相加
    C:数组数据合并
    D:字符串连接
  17. 下列PHP函数中不能直接在页面输出字符串的函数是( )。

  18. A:print
    B:echo
    C:sprintf
    D:printf

温馨提示支付 ¥3.00 元后可查看付费内容,请先翻页预览!
点赞(2) dxwkbang
返回
顶部