PHP Quiz for dummies #2

Questions about PHP. #2
Quiz by textreader
Rate:
Last updated: March 14, 2024
You have not attempted this quiz yet.
First submittedMarch 14, 2024
Times taken6
Average score73.3%
Report this quizReport
5:00
The quiz is paused. You have remaining.
Scoring
You scored / = %
This beats or equals % of test takers also scored 100%
The average score is
Your high score is
Your fastest time is
Keep scrolling down for answers and more stats ...
1. How do you output "Hello World" in PHP
echo "Hello World';
Document.Write("Hello World");
"Hello World";
Console.WriteLine("Hello World");
2. What is the right way to end a PHP statment?
:
;
New line
3. What is the correct way to add 1 to the $count variable in PHP?
$count =+ 1
$count++;
++count;
$count = 1;
4. Which one of these variables has an illegal name?
$variablename
$variableName
$variable_name
$variable-name
5. Which one of these operators is used to check if two values are equal and if their data type is the same?
==
!=
===
=!
6. Is PHP case sensitive?
True
False
7. Which of the following functions is used to return the sum of the values in an array?
in_array();
array_sum();
array_multiply();
array_add();
8. How do you get information from a post form in PHP?
$POST[];
$_GET[];
$FORM[];
$_POST[];
9. How do you create a cookie in PHP?
setcookie();
makecookie();
cookie();
createcookie
10. Which of the following answers is correct about NULL?
NULL is a special type that only has one value
The special constant NULL is capitalized but actually it is insensitive
Both of the above
None of the above
11. Which of the following magic constant returns the class name in PHP?
_CLASS_
_FILE_
_NAME_
_CONST_
12. How do you access a file uploaded via POST method in PHP?
$FILE
$FILES
$_FILES
$_SERVER
13. How do you define a constant in PHP?
const
define
var
let
14. Which of the below method is used to generate the unique id in PHP?
id();
uniqid();
generate();
None of the above
15. Which of the following is used to redirect thru PHP pages?
redirect();
send();
link();
header();
Comments
No comments yet