下列程序的执行结果是:<?php$cars=array("Volvo","BMW","Toyota");echo "I like " . $cars[0] . ", " . $cars[1] . " and " . $cars[2] . ".";?>
举一反三
- php[br][/br]$cars=array("Volvo","BMW","Toyota");[br][/br]echo "I like " . $cars[0] ;[br][/br]?>[br][/br](5.0) A: Volvo B: BMW C: Toyota
- $cars=array("Volvo","BMW","SAAB",10,3.14,true); 如果访问其中值为10的这个元素,访问方式是$cars[ _____ ]?
- 已知列表cars=['bmw','audi','toyota','subaru'],为了得到列表['subaru',<br/>'toyota', 'audi', 'bmw'],应该使用下面哪个方法(<br/>) A: cars.reverse() B: cars.reverse(True) C: cars.sort() D: sorted(cars)
- ls=[ [1,2,3,4],['a','b','c','d'],['列','表'] ][br][/br] 请写出结果: ls[0] (1) ls[0][0] (2) ls[1][0:2] (3)
- 下面代码的结果是var cars = ['bmw','qq','byd','glof']; cars.splice(2,0,'polo'); console.log(cars); A: ["bmw", "qq", "byd", "polo", "glof"] B: ["bmw", "qq", "polo", "glof"] C: ["bmw", "qq", "polo", "byd", "glof"] D: 以上都不对