NEW
Font size
WorksheetsDay 1 PHP
Total questions: 15
Worksheet time: 8mins
Which of the following statements regarding PHP is untrue?
PHP is an open-source scripting language.
PHP code can run only on Windows servers.
PHP is a loosely typed language.
PHP scripts can access databases.
What is the full form of PHP?
Personal Home Page
PHP Hypertext Preprocessor
Preprocessed Hypertext Processor
Programming Hypertext Processor
Which of the subsequent PHP versions entered the OOP stage?
PHP 3
PHP 4
PHP 5
PHP 7
Which of the following statements is NOT correct regarding PHP?
Execution independent of the platform
Supports procedural and object-oriented paradigms
It needs to be compiled before it gets executed
Can be embedded within HTML
What happens when a client requests a PHP page for the first time?
The PHP code is executed on the client end.
The browser directly receives the PHP code.
The web server processes the PHP code and returns it as an HTML response.
The PHP script is loaded and then transformed into machine code before its execution.
Which of the following is the correct way to start a PHP script?
…
{php} … {/php}
Correct method to end a PHP statement:
. (dot)
, (comma)
; (semicolon)
: (colon)
How do you do it correctly with respect to embedding PHP code into an HTML file?
Using tags
Using {php} … {/php} syntax
Using inside the HTML file
Using comments
Which of the following PHP statements is true?
All PHP statements must be enclosed within curly braces {}
Statements of PHP must be in uppercase letters to signify a statement
PHP statements are case sensitive
Statement in PHP does not need a semicolon at the end
What is the correct syntax for a multi-line comment in PHP?
// This is a multi-line comment
/* This is a multi-line comment */
# This is a multi-line comment
Which of the following is NOT a correct way to declare a variable in PHP?
$myVar = 10;
int $myVar = 10;
var $myVar = 10;
$10myVar = "hello";
Which of the following variable names is valid in PHP?
$123var
$var_123
$_my-var
varName$
How constant value is defined in PHP?
define("MY_CONST", "value");
const MY_CONST = "value";
Both a and b
None of the above
What is the purpose of the 'echo' statement in PHP?
To output data to the screen
To declare a variable
To create a function
To include a file
What will be the output of this PHP statement?
echo 2 ** 3 ** 2;
64
512
9
81
