100% found this document useful (2 votes)
1K views

PHP Exam

The document contains a 10 question quiz about PHP fundamentals. It covers topics like whether PHP is open source (it is), the differences between print() and echo(), what Ajax is (asynchronous JavaScript), that PHP is a server-side language, and functions of setcookie() and variables like $get, $request, and $post but not $ask. The main advantage of client-side languages is fast response.

Uploaded by

wdusif2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
1K views

PHP Exam

The document contains a 10 question quiz about PHP fundamentals. It covers topics like whether PHP is open source (it is), the differences between print() and echo(), what Ajax is (asynchronous JavaScript), that PHP is a server-side language, and functions of setcookie() and variables like $get, $request, and $post but not $ask. The main advantage of client-side languages is fast response.

Uploaded by

wdusif2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

General:

1- PHP is open source software?


(A) True.
(B) False.
Answer: A
2- What is the difference between print() and echo()?
(A)
(B)
(C)
(D)
(E)

print() can be used as part of an expression, while echo() cant.


echo() can be used as part of an expression, while print() cant.
echo() can be used in the CLI version of PHP, while print() cant.
print() can be used in the CLI version of PHP, while echo() cant.
Theres no difference: both functions print out some text!

Answer: A
3- In brief, what is Ajax?
[There is deferent way to write about the Ajax]
4- Do you have experience with Ajax? [Yes] [No]
Answer: Preferable candidate with Ajax experience.
5- PHP is:
(A) Server-side language.
(B) Client-side language.
Answer: Correct answer is server-side.
6- What is the main advantage of Client-side programming language?
Answer: Fast response.
7- What is the below function code (fun1) use for?
<?
function fun1($X) {
if(ereg("([[:alnum:]\.\-]+)(\@[[:alnum:]\.\-]+\.+)", $X)) {
return 1;
} else {
return 0;
}
}
?>
Answer: The above code is e-mail validation function.

8- Which of the following method sends input to a script via a URL?


(A) Get.
(B) Post.
(C) Both
(D) None
Answer: A
9- The function setcookie( ) is used to?
(A) Enable or disable cookie support
(B) Declare cookie variables
(C) Store data in cookie variable
(D) All of above
Answer: C

10- Which of the following variables is not a predefined variable?


(A)
(B)
(C)
(D)

$get
$ask
$request
$post

Answer: B

You might also like