Books
Learn HTML
Learn CSS
Learn Git
Learn Javascript
Learn PHP
Learn python
Learn Java
Exercises
HTML
JavaScript
Git
CSS
PHP
Courses
Quizzes
Snippets
Tools
General Tools
Password Generator
HTML Editor
HTML Encoder
Base 64
Code Diff
JSON Beautifier
CSS Beautifier
Markdown Convertor
Find the Closest Tailwind CSS Color
Phrase encrypt / decrypt
Browser Feature Detection
Number convertor
JTW Decoder
CSS Maker
CSS Maker
CSS Maker text shadow
CSS Maker Text Rotation
CSS Maker Out Line
CSS Maker RGB Shadow
CSS Maker Transform
CSS Maker Font Face
Color Tools
Color Picker
Colors CMYK
Colors HWB
Colors HSL
Color Hex
Color mixer
Color Converter
Colors RGB
Color Contrast Analyzer
Color Gradient
String Tools
String Length Calculator
MD5 Hash Generator
Sha256 Hash Generator
String Reverse
URL Encoder
URL Decoder
Base 64 Encoder
Base 64 Decoder
Extra Spaces Remover
String to Lowercase
String to Uppercase
Word Count Calculator
Empty Lines Remover
HTML Tags Remover
Binary to Hex
Hex to Binary
Rot13 Transform on a String
String to Binary
Duplicate Lines Remover
EN
DE
RU
FR
ES
Change theme
Dark
Light
System
Books
Learn HTML
Learn CSS
Learn Git
Learn Javascript
Learn PHP
Learn python
Learn Java
How To
How To NodeJs
How To Linux
How To AngularJs
How To PHP
How To HTML
How To CSS
How To Symfony
How To Git
How To Apache
How To JavaScript
How To Java
How To Vue.js
How To Python
PHP basics
1/25
Which of the following extensions is a correct PHP file extension?
.html
.cpp
.php
.pxp
Next >
2/25
What does a semicolon indicate?
The end of a PHP statement or instruction
The start of a PHP statement or instruction
The end of a PHP script block
The start of a PHP script block
Next >
3/25
Which is the correct way to start a single line PHP comment?
//
#
!!
/
Next >
4/25
How do you output "Hello W3docs" in PHP?
Hello W3docs;
echo Hello W3docs;
echo (Hello W3docs) ;
echo ("Hello W3docs") ;
echo 'Hello W3docs' ;
Next >
5/25
An array is a special variable that is capable of holding more than one value at a time.
True
False
Next >
6/25
The (2>0 || 4>5) condition will return
True
False
Next >
7/25
When is the default case of switch statement executed?
When one of cases evaluate to true
When other cases evaluate to false
When other cases evaluate to true
Always
Next >
8/25
Which function in PHP is used to read the content of a file?
file_get_contents()
fopen()
readfile()
file()
Next >
9/25
In PHP, which operator is used for object comparison?
==
===
<=>
instanceof
Next >
10/25
How do you handle exceptions in PHP?
Using 'if-else' statements
Using 'try-catch' blocks
Using 'error-reporting' functions
PHP does not support exception handling
Next >
11/25
Which global variable in PHP holds information about headers, paths, and script locations?
$_GET
$_POST
$_SERVER
$_ENV
Next >
12/25
Which PHP function is used to check if a variable is an array?
is_array()
is_var_array()
array_check()
is_var()
Next >
13/25
What is the correct way to include a file in PHP without causing a fatal error if the file is missing?
include_once('file.php');
require('file.php');
include('file.php');
require_once('file.php');
Next >
14/25
Which PHP function is used to sort an array in descending order?
sort()
rsort()
usort()
asort()
Next >
15/25
What is the correct way to declare a PHP interface?
interface MyInterface {}
class MyInterface {}
new Interface MyInterface {}
implement MyInterface {}
Next >
16/25
Which PHP function is used to send a custom HTTP header?
set_header()
http_header()
header()
send_header()
Next >
17/25
In PHP, which function can you use to convert a string to an integer?
str_to_int()
int()
intval()
to_integer()
Next >
18/25
Which statement is true about PHP namespaces?
PHP does not support namespaces
Namespaces are used to create aliases for classes
Namespaces are used to organize code into logical groups
Namespaces are used for extending classes
Next >
19/25
Which PHP function is used to generate a unique identifier?
md5()
uniqid()
random_id()
generate_id()
Next >
20/25
What does the 'final' keyword do when applied to a class method in PHP?
Makes the method static
Prevents the method from being overridden in child classes
Makes the method abstract
Indicates the method is the last in the class
Next >
21/25
Which of the following is NOT a valid visibility keyword in PHP?
public
private
protected
internal
Next >
22/25
Which function in PHP is used to get the length of a string?
strlen()
strlength()
stringlen()
length()
Next >
23/25
What is the purpose of the 'array_merge()' function in PHP?
Merges one or more arrays into one array
Finds the intersection of two arrays
Splits an array into multiple arrays
Duplicates an array
Next >
24/25
How do you declare an indexed array in PHP?
$array = array(1, 2, 3);
$array = [1 => 'a', 2 => 'b'];
$array = (1, 2, 3);
$array = {1, 2, 3};
Next >
25/25
What is the use of the 'empty()' function in PHP?
Checks if a variable is empty
Empties the content of a variable
Deletes a variable
Checks if a variable is not set
Next >
To get the result of the quiz, please provide your email address (optional)..
Get Certificate
It seems you haven't answered any questions yet. Please provide your answers to proceed.