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";

Skor Tablosu

Görsel stil

Seçenekler

Şablonu değiştir

Otomatik olarak kaydedilen geri yüklensin mi: ?