Saturday, November 21, 2009
Link Dir
Download
Resources
Music
Home
IT Quiz Menu
Quizzes Home Page
General Quizzes and Trivia
PC Troubleshooting
Networking Guide
Info Tech Glossary
Code Bank
Web Development
IT Quizzes Category
ASP
ASP 2
ASP ADO
ASP Server Side Include
ASP.NET
C# .NET
CISCO-CCNA
Computer Hardware
Computer Technolgy
Computer Trivia
CSS
Database Management
HTML
IIS 6 Administration
Java
JavaScript
Javascript Fundamental
Linux
MCSE 70-291
Network Plus
Networking
Networking 2
OSI Model
PERL
PHP
Project Management
Search Engine Optimization
Server Administrator
SQL
SQL Advanced
SQL Server Administration
VB.NET
Web Designer
Windows 2000 Server
Windows 2003 Server Adminstration
XHTML
XML
Search Web Link
Search Software
Quizzes Main Page
IT Quizzes
PHP Quiz
PHP Quiz
There are 29 questions in this quiz. Good luck!
Passing grade is 70% = C.
1)
In PHP, arrays may be sorted with which of the following functions?
a)
uksort()
b)
arsort()
c)
ksort()
d)
All of the above
2)
PHP comments for a single line have the following syntax:
a)
/* comments /*
b)
#
c)
//
d)
::
3)
Which of the following functions are used by PHP to find out what type a variable is?
a)
gettype()
b)
is_double()
c)
get_type()
d)
is_date()
e)
A&B
4)
The three possible connection states in PHP are ________.
a)
normal
b)
aborted
c)
timeout
d)
All of the above
5)
In PHP, the error control operator is ________.
a)
*
b)
%
c)
@
d)
&
6)
In PHP, instructions are terminated with a _______.
a)
;
b)
#
c)
!
d)
%>
7)
What does PHP stand for?
a)
PHP: Hypertext Preprocessor
b)
Personal Home Page
c)
Private Home Page
d)
Personal Hypertext Processor
8)
PHP server scripts are surrounded by delimiters, which?
a)
<?php>...</?>
b)
<?php…?>
c)
<script>...</script>
d)
<&>...</&>
9)
How do you write "Hello World" in PHP
a)
"Hello World";
b)
echo "Hello World";
c)
Document.Write("Hello World");
d)
response.write("Hello World")
10)
All variables in PHP start with which symbol?
a)
!
b)
$
c)
&
d)
#
11)
Include files must have the file extension ".inc"
a)
True
b)
False
12)
In PHP you can use both single quotes ( ' ' ) and double quotes ( " " ) for strings:
a)
True
b)
False
13)
What is the correct way to include the file "time.inc" ?
a)
<!--include file="time.inc"-->
b)
<?php include_file("time.inc"); ?>
c)
<?php require("time.inc"); ?>
d)
<% include file="time.inc" %>
14)
What is the correct way to create a function in PHP?
a)
function myFunction()
b)
new_function myFunction()
c)
create myFunction()
15)
What is the correct way to connect to a MySQL database?
a)
mysql_open("localhost");
b)
connect_mysql("localhost");
c)
dbopen("localhost");
d)
mysql_connect("localhost");
16)
What is the correct way to add 1 to the $count variable?
a)
count++;
b)
$count++;
c)
++count
d)
$count =+1
17)
PHP can be run on Microsoft Windows IIS(Internet Information Server):
a)
True
b)
False
18)
In PHP 5, MySQL support is enabled by default:
a)
True
b)
False
19)
Which one of these variables has an illegal name?
a)
$my-Var
b)
$myVar
c)
$my_Var
20)
Which of the following regular expressions will match the string no.no.no?
a)
no?no?no
b)
no*no*no*
c)
..\...\...
d)
\.\..\.\..\.\.
21)
A constructor is a special kind of…
a)
Class
b)
Method
c)
Object
d)
Variable
22)
What can you use to replace like with hate in I like Eminem?
a)
preg_replace("like", "hate", "I like Eminem")
b)
preg_replace("/like/", "hate", "I like Eminem")
c)
preg_replace("/like/", "/hate/", "I like Eminem")
d)
preg_replace("hate", "like", "I like Eminem")
23)
What library do you need in order to process images?
a)
c-client library
b)
GIF/PNG library
c)
Image Library
d)
GD library
24)
What is the problem with <?=$expression ?> ?
a)
It requires short tags and this is not compatible with XML
b)
There is no problem
c)
This syntax doesn't even exist It requires a special PHP library that may not always be available
25)
What does break; do?
a)
Ends execution of the current switch structure
b)
Moves on to the next iteration of the current for, foreach, while, do-while or switch structure
c)
Ends execution of the current for, foreach, while, do-while or switch structure
26)
Can this PHP code be valid: $4bears = $bears->getFirst4();
a)
Yes
b)
No
27)
Assuming all the variables a, b, c have already been defined, could this be a variable name: ${$a}[$b][$c] ?
a)
Yes
b)
No
28)
Put this line php display_errors=false in a .htaccess file when you deploy the application?
a)
That won't hide any error 'coz you can't use .htaccess to control the PHP engine Bad idea, I want to see when errors occur
b)
That won't hide any error 'coz it's not the correct code
c)
Good idea, increases security
29)
What does this function do: <?php function my_func($variable) {return (is_numeric($variable) && $variable % 2 == 0);}?>
a)
tests whether $variable is a number and ends in 2
b)
tests whether $variable ends in 2
c)
tests whether $variable is a number and contains 2
d)
tests whether $variable is an even number
E-mail this Quiz to a friend
Bookmark this Quiz