WorksheetsQuizz PHP dasar Kelas 11 PPLG 1
Total questions: 25
Worksheet time: 8mins
apa Kepanjangan dari PHP?
Personal Hypertext Prosesor
PHP: Hypertext Prosesor
Private Home Page
PHP server scripts are surrounded by delimiters, which?
<?php ?>
<?php>..</?>
<&>...</&>
<script>...</script>
How do you write "Hello World" in PHP
echo"Hello Word";
Document.Write("Hello Word");
"Hello Word";
All variables in PHP start with which symbol?
$
!
&
*
What is the correct way to end a PHP statement?
New Line
.
</php>
;
The PHP syntax is most similar to:
JavaScript
Perl and C
VBScript
How do you get information from a form that is submitted using the "get" method?
Request.Form;
Request.QueryString;
$_GET[];
When using the POST method, variables are displayed in the URL:
true
false
In PHP you can use both single quotes ( ' ' ) and double quotes ( " " ) for strings:
false
true
Include files must have the file extension ".inc"
true
false
What is the correct way to include the file "time.inc" ?
<?php include "time.inc";?>
<?php include:"time.inc";?>
<?php include file="time.inc";?>
<!--include file="time.ic" -->
What is the correct way to create a function in PHP?
new_function myFungtion()
function myFungtion()
create myFunction()
What is the correct way to open the file "time.txt" as readable?
open("time.text","read");
fopen("time.text","r+");
fopen("time.text","r");
open("time.txt");
PHP allows you to send emails directly from a script
true
false
Which superglobal variable holds information about headers, paths, and script locations?
$_SERVER
$_GLOBAL
$_SESSION
$_GET
What is the correct way to add 1 to the $count variable?
count++
++count
$count=+1
$coount++
What is a correct way to add a comment in PHP?
<comment>...</comment>
<!--...-->
\*...*\
/.../
PHP can be run on Microsoft Windows IIS(Internet Information Server):
true
false
The die() and exit() functions do the exact same thing.
true
false
Which one of these variables has an illegal name?
$my-var
$my_var
$myVar
How do you create a cookie in PHP?
createcookie
makecookie
setcookie()
In PHP, the only way to output text is with echo.
True
False
How do you create an array in PHP?
$car = array("Honda", "BMW", "Toyota");
$car = array["Honda", "BMW", "Toyota"];
$car = "Honda", "BMW", "Toyota";
The if statement is used to execute some code only if a specified condition is true
true
false
Which operator is used to check if two values are equal and of same data type?
!=
==
===
=
