1) How a variable is declared in PHP? a) ?variableName=value; b) $variableName=value; c) =variableName=value; d) variableName=value; 2) What is the code to output "Hello World"? a) cout>>Hello World>/ b) cin>>Hello World>/ c) Hello World d) echo "Hello World"; 3) What is the correct opening tag and close tag for PHP scripts? a) opening tag = <?php / close tag = <? b) opening tag = <?php / close tag = ?> c) opening tag = include iostream / close tag = / d) opening tag = <? / close tag = ?> 4) What is the single-line comment in php? a) ** b) // c) */ d) *// 5) What is the multi-line comment in php? a) /* comment */ b) // comment // c) ** comment ** d) ?>php comment ?> 6) Create a variable named txt and assign the value "Hello" a) txt= "Hello"; b) <?php txt= "Hello"?> ; c) $txt= "Hello"; d) $Hello= "txt"; 7) Create an if else code when $a is greater than $b, it will print Hello. a) if ($a>$b) = cout Hello b) if ($a>$b) {echo "Hello World"; } c) if ($b>$a) {echo "Hello World"; } d) if ($a=$b) {echo "Hello World"; } 8) Call (execute) a function named myFunction a) int myFunction b) include int myFunction c) call myFunction; d) myFunction() 9) Here you see an associative array. Output "age" of Ben. $age = array("Peter"=>"35", "Ben"=>"37","Joe"=>"43"); a) echo "Ben is " .$age['Ben']. " years old."; b) echo "Ben is " .$age['37']. " years old."; c) echo "Ben is " .$array['37']. " years old."; d) echo "Ben is " .$age['Peter']. " years old."; 10) Create a session variable named "favcolor". a) session_start(); $_SESSION["green"] = "favcolor"; b) session_start(); $_SESSION["favcolor"] = "green"; c) session_stop(); $_SESSION["favcolor"] = "green"; d) session_stop(); $_SESSION["green"] = "favcolor";
0%
PHP
共享
共享
共享
由
Intannazira2110
编辑内容
打印
嵌入
更多
作业
排行榜
显示更多
显示更少
此排行榜当前是私人享有。单击
,共享
使其公开。
资源所有者已禁用此排行榜。
此排行榜被禁用,因为您的选择与资源所有者不同。
还原选项
问答游戏
是一个开放式模板。它不会为排行榜生成分数。
需要登录
视觉风格
字体
需要订阅
选项
切换模板
显示所有
播放活动时将显示更多格式。
打开成绩
复制链接
QR 代码
删除
恢复自动保存:
?