Final Exam
Final Exam
General Instructions: No Permit – No Exam | Write your answers on the booklet provided. | Follow the given
instructions below and do not write anything on the Test Questionnaire.
I. Choose or supply the correct answer for the following. (2 pts each)
1. Which of the following code snippet corrects represents a an indexed array? (2 pts each)
a) $ arr[3]=array("a","b",c");
c) $arr= array("a"=>"0","b"=>"1","c"=>"2");
d) $arr=array("a","b","c");
2. Which of the following built-in function is used for starting a PHP session? (2 pts each)
a) open_session()
b) session_start()
c) set_session()
d) create_session()
3. What will be the correct output against the following code snippet ? (2 pts each)
<?php $a=7;
do{
$a ;
}while($a<=5);
?>
5. Create the correct syntax in displaying the word php on a browser. (3 pts each)
6. Which of the following built-in function is used in php to get the length of the array? (2 pts each)
a) contents()
b) length()
c) size()
d) count()
8. What will be the correct output against the following code snippet? (2 pts each)
<?php
$x=2;
$y=6;
echo "hello".$x+$y;
?>
9. Which of the following built-in function is used for creating the cookies in PHP? (2 pts each)
a) cookie_start()
b) getcookie()
c) setcookie()
d) createcookie()
12. What is used for adding the other php file in an existing php file. (2 pts each)
13. Create a function that will calculate the fourthroot of a number. (5 pts each)
14. Write a syntax that connects a sample.php file to your front page. (3 pts each)
17. What’s the difference of a GET method from POST method? (2 pts each)
19. Give 5 logical operators and its usage. (10 pts each)
20. What is a value of a variable that can be only used inside a functions? (2 pts each)
II. Design the following according the given format. (5 pts each)