Login | Contact Us | Site Map | Resources

Beginner PHP Quiz

Log in before taking this test if you want your score to be saved in order to receive a certification of achievement. If you are not yet a member, you can register free of charge.

1. Which of the following statements will cause an error?

echo " ";

print " ";

echo ' ';

print ' ';

echo $variable


2. A string can contain numerical values.

True

False


3. Which of the following are examples of logical operators?

=, .=, +=, -=, *=, /=, and %=

&&, || and !

+, -, *, / and %

==, !=, <> <, <=, >, and >=

++ and --


4. Which of the following are examples of comparison operators?

=, .=, +=, -=, *=, /=, and %=

&&, || and !

+, -, *, / and %

==, !=, <> <, <=, >, and >=

++ and --


5. What symbol is used to terminate (or indicate the end of) statements?

;

:

.

-

#


Bonus Question: What kind of pole is short and floppy?

The north pole!

A barber pole!

A tadpole!

A bean pole!

A totem pole!


6. Mathematical functions can be performed on numerical strings.

True

False


7. What is php?

a type of web server

a scripting language

a client

a type of database


8. Which of the following is not a type of comment?

#

/* */

//

*


9. What, in a php program, is used to store values so that they can be used again?

a function

a variable

a comment

an operator

parentheses


10. Which of the following is one correct way to set a variable?

&variable = ' ';

$variable - " ";

variable = ' ';

$variable = ';

$variable = ' ';


11. What are the standard (preferred/safest) opening and closing php tags?

<? ?>

<?php ?>

<% %>

<script language="php"> </script>


Bonus Question: What animals are on legal documents?

Elephants

Ants

Whales

Seals

Dogs


12. Will a php script work if it is in a file with a ".html" file extension?

Yes

No

Maybe