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 代碼
刪除
恢復自動保存:
?