Back To CalendarScripts

PHP Test
A test for PHP Developers. This test is for demonstration purpose of Watu Exam. Some of the questions are taken from W3Schools.

What does PHP stand for?

PHP: Hypertext Preprocessor
Personal Hypertext Page
Programming Home Processor


By which delimiters are PHP server scripts surrounded?

<?php>...</?>
<script>...</script>
<php></php>
<?php…?>
<%...%>


How do you write "Hello World" in PHP?

Document.Write('Hello World')
echo 'Hello World';
copy con prn 'Hello World'
> 'Hello World'


In PHP what starts with "$" symbol?

Variables
Function names
Calculations


What does the "break" statement do in PHP?

Exits the scrtipt
Breaks string into smaller parts
Exits a loop


In PHP the following is allowed:

To end statements without ;
To put or not to put spaces between varibles or operators by your choice
To start variable names with a number


How do you get information from a form that is submitted using the "get" method?

Request.GET;
$_GET[];
$_REQUEST[].QueryString();


When using the POST method, variables are displayed in the URL:

True
False


In PHP you can use both single quotes ( ' ' ) and double quotes ( " " ) for strings:

True
False


Include files must have the file extension ".inc"

True
False


Why having .inc extension is not a good idea for the include files?

Because a PHP script with .inc extension will not work
Because such a file could be downloaded from the browser if someone knows the URL
It is not a bad idea to have .inc extension - it is a requirement


What is the correct way to create a function in PHP?

new_function myFunction()
create myFunction()
function myFunction()


What is the correct way to open the file "time.txt" as readable?

open('time.txt');
fopen('time.txt','r');
fopen('time.txt','r+');
open('time.txt','read');


PHP allows you to send emails directly from a script

True
False


What is the correct way to connect to a MySQL database?

mysql_open();
connect_mysql();
dbopen();
mysql_connect();


What is the correct way to add 1 to the $count variable?

++count
$count++
$count =+1
count++;


What is a correct way to add a comment in PHP?

/*…*/
*\..\*
<comment>…</comment>
<!--…-->


PHP can be run on Microsoft Windows IIS(Internet Information Server):

True
False


In PHP 5, MySQL support is enabled by default:

True
False


Which one of these variables has an illegal name?

$myVar
$my_var
$my-var



Please enter personal details

Name:
Email: