Thursday, May 24, 2012

PHP quiz




The following PHP quiz is written using Java Script.   You can answer each question only once. Your score will be shown.
1.All variables in PHP start with which symbol?
&
$
!
#
2. In PHP you can use both single quotes ( ' ' ) and double quotes ( " " ) for strings:
True
False
I do not know
Not Always
3. Which is correct to include a file in PHP:
include('header.php');
#
include('header.php');
#require('header.php');
$require_once('header.php');
4.What can you use to replace dog with cat
preg_replace("dog", "cat", "I like dog");
preg_replace("cat", "dog", "I like dog");
preg_replace("/dog/", "cat", "I like dog");
preg_replace("dog", "/cat/", "I like dog");
5. Which syntax write "Hello World" in PHP
write('Hello World");
echo 'Hello World';
document.write("Hello World");
cout<<"Hello World";
6. What does PHP stand for?
Personal Homepage Preprocessor
PHP: Hypertext Preprocessor
Permanent Header Profile
Preprocessor Header Profile
7. PHP server scripts are surrounded by which delimiters?
<?php> <?>
<?php        ?>
<??            ??>
<?       php?>
8. What is the correct way to connect to a MySQL database localhost?
connect_db("localhost");
connect_mysql("localhost");
mysql_connect("localhost");
db_connect("localhost");
9. PHP comments have the following syntax:
//
#
!
<--?
10. Award!!! -- This blog is written by?
Jessie
Andy Lu
Jiansen Lu
All of Above























No comments:

Post a Comment