Test Your PHP Knowledge (2)

Put your PHP skills to the test with 12 challenging questions covering various aspects of the language.

published on August 20
1/12

What does PHP stand for?

Personal Hypertext Processor
PHP: Hypertext Preprocessor
Programming Hypertext Processor
Pretty Helpful Programming
2/12

Which of the following is NOT a valid PHP variable name?

Which of the following is NOT a valid PHP variable name?
$my_var
$123var
$_myVar
$var123
3/12

What does echo do in PHP?

What does echo do in PHP?
Prints output to the screen
Assigns a value to a variable
Redirects to another webpage
Executes a SQL query
4/12

Which of the following is a valid way to start a PHP code block?

Which of the following is a valid way to start a PHP code block?
<?PHP
<script>
<?php
<!--?php
5/12

What is the file extension for PHP files?

.html
.js
.php
.css
6/12

Which PHP function is used to read a file?

file_get_contents()
readfile()
fopen()
file_read()
7/12

How do you comment a single line in PHP?

// This is a comment
# This is a comment
; This is a comment
8/12

Which PHP function is used to check if a variable is an array?

is_array()
array_check()
check_array()
isArray()
9/12

What does the '->' operator do in PHP?

What does the '->' operator do in PHP?
Access properties or methods of an object
Perform arithmetic division
Concatenate strings
Increment a variable
10/12

Which PHP superglobal array holds form input data?

Which PHP superglobal array holds form input data?
$_POST
$_GET
$_REQUEST
$_FORM
11/12

What does the function json_encode() do in PHP?

Decodes a JSON string
Encodes a PHP array into a JSON string
Converts a PHP array into a JSON object
Decodes a PHP object
12/12

What is the output of the following code: echo strlen('Hello World');?

What is the output of the following code: echo strlen('Hello World');?
11
10
12
9