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
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
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
How do you start the PHP scripting block?
<?php … ?php>
<script … script>
<?php … ?>
<php… >
<? … ?>
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
PHP variables need to be declared before adding values to them
True
False
Next >
4/25
Which is the correct way to declare a PHP variable?
val = 10;
$10 = 'val';
$val;
$val = 10;
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
In PHP, which operator is used for object comparison?
==
===
<=>
instanceof
Next >
7/25
What is the purpose of the 'include' statement in PHP?
To import classes from another file
To include HTML markup
To include and execute the specified file
To add external libraries
Next >
8/25
What is the correct way to end a PHP statement?
.
;
:
End
Next >
9/25
Which global variable in PHP holds information about headers, paths, and script locations?
$_GET
$_POST
$_SERVER
$_ENV
Next >
10/25
In PHP, what does the 'array_pop()' function do?
Removes the last element from an array
Deletes the first element of an array
Pops a new element into the array
Returns the value of the last element
Next >
11/25
What does the 'var_dump()' function in PHP do?
Dumps variable content to a file
Displays structured information about a variable
Deletes a variable
Validates a variable's type
Next >
12/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 >
13/25
How can you create a multiline comment in PHP?
// comment
# comment
/* comment */
<!-- comment -->
Next >
14/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 >
15/25
Which of the following is NOT a valid visibility keyword in PHP?
public
private
protected
internal
Next >
16/25
How do you access a PHP superglobal variable inside a function?
By declaring it as global inside the function
By passing it as an argument to the function
By using the 'this' keyword
Superglobals are always accessible, no need for special syntax
Next >
17/25
What does the '===' operator in PHP do?
Compares the value and the type of two variables
Compares only the value, not the type
Assigns the value from right to left
Compares two variables for inequality
Next >
18/25
In PHP, which operator is used for error control?
@
#
!
$
Next >
19/25
How do you check if a PHP variable is of type object?
is_object()
is_type('object')
typeof()
instanceof
Next >
20/25
Which of the following is a correct way to define a case-insensitive constant in PHP?
define('CONSTANT', 'value', true);
const CONSTANT = 'value';
define_case_insensitive('CONSTANT', 'value');
constant('CONSTANT', 'value');
Next >
21/25
Which function in PHP can be used to create a new directory?
mkdir()
create_dir()
new_directory()
dir_create()
Next >
22/25
What does the 'file_put_contents()' function in PHP do?
Reads content from a file
Writes a string to a file
Deletes content from a file
Appends content to a file
Next >
23/25
What is the correct way to declare a PHP namespace?
namespace MyNamespace;
use MyNamespace;
package MyNamespace;
create_namespace MyNamespace;
Next >
24/25
How can you append an element to an existing array in PHP?
$array[] = 'new_element';
array_append($array, 'new_element');
$array.add('new_element');
append($array, 'new_element');
Next >
25/25
In PHP, what is a trait?
A method to create abstract classes
A mechanism for code reuse in single inheritance languages
A type of PHP variable
An interface implementation
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.