<;?php$str2="what Is YOUR name"; $replace2=array("a","o","A","O"); echo str_replace($replace2,"",$str2)."<;br>;";?>;以上程序的运行结果是( )。
A: wht Is YUR nme
B: whAt Is YoUR nAme
C: Is
D: a o A O
A: wht Is YUR nme
B: whAt Is YoUR nAme
C: Is
D: a o A O
举一反三
- $str = "My name is Jack, and what is your name?";echo substr_count ($str,“name”);程序的输出结果为()。 A: 1 B: 2 C: 3 D: 4
- 下面代码运行后输出的结果是( )。$str="phper";$replace="mysql";echo substr_replace($str,$replace,1,2); A: pmysqler B: phpermysql C: mysql D: pmysql
- 以下程序能够实现输出“PHP从入门到精通”的有() A: php $str=array('PHP','从入门','到精通'); foreach($str as $link){ echo $link; } B: 'PHP','2'=>'从入门','3'=>'到精通'); for($i=0;$i<=2;$i++){ echo $str[$i]; } C: 'PHP','2'=>'从入门','3'=>'到精通'); for($i=1;$i<=3;$i++){ echo $str[$i]; } D: php $str=array('PHP','从入门','到精通'); for($i=0;$i<=2;$i++){ echo $str[$i]; }
- 以下涉及字符串数组、字符指针的程序段,没有编译错误的是______。 A: char* str, name[5]; str = "C/C++"; B: char* str, name[6]; name = "Hello"; C: char str1[7] = "prog.c", str2[8]; str2 = str1; D: char line[]; line = "//////";
- 以下不能正确进行字符串初始化的语句是: A: char str[5] = "good!"; B: char str[5] = {'g', 'o', 'o', 'd', '!'}; C: char str[] = {'g', 'o', 'o', 'd', '!'}; D: char str[] = "good!"; E: char str[8] = "good!"; F: char *str = "good!"; G: char str[8] = {'g', 'o', 'o', 'd', '!'};