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
How do you start the PHP scripting block?
<?php … ?php>
<script … script>
<?php … ?>
<php… >
<? … ?>
Next >
2/25
Whitespace is not ignored in PHP
True
False
Next >
3/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 >
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
The (2>0 || 4>5) condition will return
True
False
Next >
6/25
The (2>0 && 4>5) condition will return?
True
False
Next >
7/25
Which function in PHP is used to read the content of a file?
file_get_contents()
fopen()
readfile()
file()
Next >
8/25
How do you declare a constant in PHP?
const CONSTANT = 'value';
define('CONSTANT', 'value');
create_constant('CONSTANT', 'value');
#define CONSTANT 'value'
Next >
9/25
In PHP, which operator is used for object comparison?
==
===
<=>
instanceof
Next >
10/25
What does the 'foreach' loop in PHP do?
It loops through each character of a string
It loops through each key-value pair in an array
It executes a block of code a specific number of times
It iterates through numeric indexed arrays only
Next >
11/25
Which PHP function is used to check if a variable is an array?
is_array()
is_var_array()
array_check()
is_var()
Next >
12/25
What is the purpose of the 'session_start()' function in PHP?
Starts a new PHP session
Starts a new server session
Initializes session variables
Creates a new session cookie
Next >
13/25
What is the correct way to add elements to an array in PHP?
$array[] = 'new_element';
array_add($array, 'new_element');
array_push('new_element');
$array->add('new_element');
Next >
14/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 >
15/25
What is the correct way to declare a PHP interface?
interface MyInterface {}
class MyInterface {}
new Interface MyInterface {}
implement MyInterface {}
Next >
16/25
What is the default session timeout in PHP?
30 minutes
24 minutes
15 minutes
60 minutes
Next >
17/25
Which PHP function is used to generate a unique identifier?
md5()
uniqid()
random_id()
generate_id()
Next >
18/25
Which of the following is NOT a valid visibility keyword in PHP?
public
private
protected
internal
Next >
19/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 >
20/25
In PHP, how do you get the current date and time?
date()
getdate()
now()
current_time()
Next >
21/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 >
22/25
Which PHP function is used to convert all applicable characters to HTML entities?
htmlentities()
htmlspecialchars()
convert_to_html()
encode_html()
Next >
23/25
How do you check if a PHP variable is of type object?
is_object()
is_type('object')
typeof()
instanceof
Next >
24/25
Which of the following is a valid way to start a session in PHP?
session_begin();
session_start();
start_session();
session_init();
Next >
25/25
What does the 'compact()' function in PHP do?
Reduces the size of an array
Creates an array containing variables and their values
Compacts HTML output
Minimizes memory usage
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.