Quiz
Chapter 6: PHP
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (16)
1All PHP statements should be surrounded by which delimiters?
- A<php> and </php>
- B<script> and ></script>
- C<script><php> and </php></script>
- D<?php and ?>
2A PHP statement is terminated with which symbol?
- A<end>
- B.
- C;
- D?
3All variables in PHP start with which symbol?
- A?
- B.
- Cvar
- D$
4In PHP, $content = "<p>Hello World</p>". Write a PHP statement that displays the content on the browser screen.
- Adisplay($content);
- Becho$content;
- Cecho "Hello World";
- Decho content;
5In PHP, you can use either single quotes ('This is a string') or double quote ("This is a string") for strings.
- Atrue
- Bfalse
6In PHP, which of the following is the correct way to comment a single line?
- A<!--This is a line of comment-->
- B<comment>This is a line of comment</comment>
- C<?php This is a line comment?>
- D//This is a line of comment
7In PHP, which of the following is NOT a correct variable name?
- A$3val
- B$val3
- C$val_3
- D$val_of_3
8In PHP, how do you add 1 to a variable called $i?
- Ai++
- Bi=+1;
- C++$i;
- D++i;
9How does PHP receive the information from an HTML form that is submitted using he "post" method? Suppose in HTML there's a text box <input type="text"name="userinput">
- A$_POST["userInput"];
- B$_GET["userInput"];
- C$_USERINPUT();
- D$_GET(userInput);
10When using the get method to submit an HTML form to a PHP file, the variables are displayed in the URL
- Atrue
- Bfalse
11Which of the following is a correct way to create and array in PHP?
- A$grades = array (78, 87, 95, 53);
- B$grades = (56, 78, 89, 90);
- C$grades = array ([56], [67], [78], [89]);
- D$grades = {56, 67, 78, 89};
12Write a PHP statement to include a file called "footer.inc"
- A<!--include file = "footer.inc"-->
- B<?php include file = "footer.inc";?>
- C<?php include "footer.inc";?>
- D<?php include: "footer.inc;?>
13In PHP, how do you retrieve the content from a file called feedback.txt and store the content in an array call $fileContent?
- A$fileContent = "feedback.txt";
- B$fileContent = php_read("feedback.txt");
- C$fileContent = file("feedback.txt");
- D$fileContent = file_read("feedback.txt");
14In PHP file upload in regards to security, which of the following is a true statement?
- ADo not allow file uploads
- BIt is safe as long as you don't allow .exe file upload
- CIt is safe as long as the file size is small
- DIt is safe as long as only an account holder can upload a file
15In PHP what will $i+=2 do?
- Aa typo
- Bthe value in the variable $i is increased by 2
- Cthe vriable $i now equals to 2
- Dthe value in the variable i is increased by 2
16In PHP a session is used so that the server can remember the browser
- Atrue
- Bfalse
Information
- Description
- Sanchez, L. (2017). Web Programming with HTML, CSS, Bootstrap, JavaScript, JQuery, PHP, and MySQL . CreateSpace Independent Publishing Platform.
- Author
- Rebecca Walton
- Language
- English
- Views
- 81
- Tags
- Rating
- No ratings yet Rate this quiz