PHP
10. Include files must have the file extension ".inc" A. True B. False
B
7. How do you get information from a form that is submitted using the "get" method? A. Request.Form; B. Request.QueryString; C. $_GET[];
C
15. Which superglobal variable holds information about headers, paths, and script locations? A. $_SERVER B. $_GET C. $_GLOBALS D. $_SESSION
A
18. PHP can be run on Microsoft Windows IIS(Internet Information Server): A. True B. False
A
19. The die() and exit() functions do the exact same thing. A. True B. False
A
21. The setcookie() function must appear BEFORE the <html> tag. A. True B. False
A
22. In PHP, the only way to output text is with echo. A. False B. True
A
23. How do you create an array in PHP? A. $cars = array("Volvo", "BMW", "Toyota"); B. $cars = array["Volvo", "BMW", "Toyota"]; C. $cars = "Volvo", "BMW", "Toyota";
A
1. What does PHP stand for? A. Personal Hypertext Processor B. PHP: Hypertext Preprocessor C. Private Home Page
B
14. PHP allows you to send emails directly from a script A. False B. True
B
20. Which one of these variables has an illegal name? A. $myVar B. $my-Var C. $my_Var
B
24. The if statement is used to execute some code only if a specified condition is true A. False B. True
B
3. How do you write "Hello World" in PHP A. "Hello World"; B. echo "Hello World"; C. Document.Write("Hello World");
B
4. All variables in PHP start with which symbol? A. ! B. $ C. &
B
6. The PHP syntax is most similar to: A. JavaScript B. Perl and C C. VBScript
B
8. When using the POST method, variables are displayed in the URL: A. True B. False
B
9. In PHP you can use both single quotes ( ' ' ) and double quotes ( " " ) for strings: A. False B. True
B
12. What is the correct way to create a function in PHP? A. create myFunction() B. new_function myFunction() C. function myFunction()
C
13. What is the correct way to open the file "time.txt" as readable? A. fopen("time.txt","r+"); B. open("time.txt"); C. fopen("time.txt","r"); D. open("time.txt","read");
C
17. What is a correct way to add a comment in PHP? A. *\...\* B. <comment>...</comment> C. /*...*/ D. <!-...->
C
5. What is the correct way to end a PHP statement? A. New line B. </php> C. ; D. .
C
11. What is the correct way to include the file "time.inc" ? A. <?php include:"time.inc"; ?> B. <?php include file="time.inc"; ?> C. <!- include file="time.inc" -> D. <?php include "time.inc"; ?>
D
16. What is the correct way to add 1 to the $count variable? A. $count =+1 B. ++count C. count++; D. $count++;
D
2. PHP server scripts are surrounded by delimiters, which? A. <?php>...</?> B. <&>...</&> C. <script>...</script> D. <?php...?>
D
25. Which operator is used to check if two values are equal and of same data type? A. != B. = C. == D. ===
D