PHP Exam

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 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