WebDevelopmentusingPHP 3
WebDevelopmentusingPHP 3
Course Title : Web Development using PHP Course Code : BVOC-SD 5.1
Instructions: Write concise, to the point answers. Longer is not always better. Rambling answers that do not convey
understanding of the subject will be penalized by lower marks. As far as possible, bullet point your answers. Please
write neatly, someone will have to read your handwriting. Clearly mark question numbers so the evaluator knows
which question you are answering.
Q1. Multiple Choice Questions : How would you store order number (34) in an ‘OrderCookie’? 1 Marks
Q2. Multiple Choice Questions : Trace the function that does continue the script execution even if 1 Marks
the file inclusion fails
1) include() 2) require() 3) both of above 4) None of above
Q3. Multiple Choice Questions : Which of the following will not combine strings $s1 and $s2 into a 1 Marks
single string?
1) $s1 + $s2 2) “{$s1}{$s2}” 3) $s1.$s2 4) implode(‘ ‘, array($s1,$s2))
Q4. Multiple Choice Questions : Which of the following statement produce different output 1 Marks
1) <?echo "This is php example"; ?> 2) <P="This is php example"; ?> 3) <?PHP echo "This is php example";
php?> 4) <script language="php"> print "This is php example";</script>
Q5. Multiple Choice Questions : Which datatypes are treaded as arrays 1 Marks
Q6. Multiple Choice Questions : Which of the following can add a row to a table 1 Marks
Q8. Multiple Choice Questions : Which of the following array represents an array containing one or 1 Marks
more arrays
1) Numeric Array 2) Associative Array 3) Multidimentional Array 4) None of the above
Q9. Multiple Choice Questions : Which of the following method can be used to parse an XML 1 Marks
document using PHP
1) simplexml_load_string() 2) loadxml() 3) Both of the above. 4) None of the above.
Q10. Multiple Choice Questions : Which of the following function returns the sum of the values in 1 Marks
an array
1) array_sum() 2) array_splice() 3) array_udiff() 4) array_udiff_assoc()
Q11. Multiple Choice Questions : Which of the following is used to check that a cookie is set or not 1 Marks
Q12. Multiple Choice Questions : Which of these characters can be processed by the 1 Marks
htmlspecialchars() function?
1) ' - single quote 2) '' - double quote 3) < - less than 4) All
Q13. Multiple Choice Questions : Which statement about the code below is correct? class A {} class 1 Marks
B {} class C extends A, B {}
1) the code is perfectly fine 2) classes can not be empty 3) class C can not extend both A and B 4) qualifiers
'public' or 'private' are missing in
class definitions
Q14. Multiple Choice Questions : What is the out put? 1 Marks
<?php
$color=array("red","yellow","white");
$x=in_array("black",$color);
if($x==0)
echo "good bye";
if($x==1) echo "Hello";
?>
Q15. Identify True or False. If False write correct statement. : Whether One-line comment begin with 1 Marks
pound sing(#) in php
1) TRUE 2) FALSE 3) None of above
2/5 Exam Paper Code - 6974
Q16. Multiple Choice Questions : Which character do the error_reporting directive use to represent 1 Marks
the logical operator NOT?
1) / 2) ! 3) ~ 4) ^
Q17. Multiple Choice Questions : The practice of creating objects based on predefined classes is 1 Marks
often referred to as
1) class creation 2) object creation 3) object instantiation 4) class instantiation
Q18. Multiple Choice Questions : Which of the following is/are the right way to declare a method? i) 1 Marks
function functionName() { function body } ii) scope function functionName() { function body
} iii) method methodName() { method body } iv) scope method methodName() { method body
} ii) 2) Only iv) 3) i) and ii) 4) iii) and iv)
1) Only
Q19. Multiple Choice Questions : Question : which of the following pair have non-associative equal 2 Marks
precedence?
1) +,- 2) ==, != 3) &=, |= 4) All of these
Q21. Multiple Choice Questions : What will be the output of following code? $a = 10; echo ‘Value 2 Marks
of a = $a’;
1) Value of a = 10 2) Value of a = $a 3) Undefined 4) Syntax Error
5) None of the
above
Q22. Multiple Choice Questions : Which of the following is a PHP resource? 2 Marks
Q23. Multiple Choice Questions : $str=”3dollars”; $a=20; $a+=$str; print($a); ?> Output ? 2 Marks
Q24. Identify True or False. If False write correct statement. : PHP runs on different platforms 2 Marks
(Windows, Linux, Unix, etc.)
1) TRUE 2) FALSE
Q25. Multiple Choice Questions : What is the difference between stat() and fstat()? 2 Marks
Q28. Multiple Choice Questions : Which of the following delimiter syntax is PHP's default delimiter 2 Marks
syntax
1) <? php ?> 2) <% %> 3) <? ?> 4) <script language="php"> </script>
Q29. Multiple Choice Questions : Which of the following delimiter is ASP style? 2 Marks
Q30. Multiple Choice Questions : Which of following function return 1 when output is successful? 2 Marks
1) $ alive is false 2) $ alive is true 3) $ alive is overflow 4) the statement is snot valid
Q32. Identify True or False. If False write correct statement. : In a SELECT with a GROUP BY 2 Marks
clause, a WHERE clause, and a HAVING clause, the WHERE conditions are applied before
the HAVING conditions
1) TRUE 2) FALSE
Q33. Multiple Choice Questions : Choose valid PHP5 data type. 2 Marks
Q34. Multiple Choice Questions : Which of the following is NOT a magic predefined constant? 2 Marks
Q35. Identify True or False. If False write correct statement. : What will be printed? if ('2' == '02') { 2 Marks
echo 'true'; } else { echo 'false'; }
1) TRUE 2) FALSE
4/5 Exam Paper Code - 6974
Q36. Multiple Choice Questions : What will be printed? $a = array( null => 'a', true => 'b', false => 2 Marks
'c', 0 => 'd', 1 => 'e', '' => 'f'); echo count($a), "\n";
1) 2 2) 3 3) 4 4) 5
5) 6
1) 43 2) 1 3) 8 4) 6
Q39. Multiple Choice Questions : what will the ouptut of below date() function ? 2 Marks
Q40) Explain : How is it possible to know the number of rows returned in a result set when using 5 Marks
MsSql with PHP?
Q41) Explain : How do I check if a given variable is empty or not? 5 Marks
Q42) Explain : Is it possible to remove the HTML tags from data? 5 Marks
Q43) Explain : How can we define a variable accessible in functions of a PHP script? 5 Marks
Q44) Explain : How can we get the error when there is a problem in uploading a file? 5 Marks
Q45) Explain : What does $_COOKIE means? 5 Marks
Q46) Explain : How session works and are handle in php 5 Marks
Q47) Explain : The importance of the function htmlentities. 5 Marks
Q48) Explain : What is the use of "ksort" in php? 5 Marks
Q49) Explain : How we can retrieve the data in the result set of MySQL using PHP? 5 Marks