QuestionQuestion

Question 1
Relational operators can only be used for numeric comparison.
True
False

Question 2
The * arithmetic operator has higher precedence than the + operator.
True
False

Question 3
Conversion between data types happens automatically when a variable is used in a context that requires a different data type.
True

False
Question 4
Which of the following is not a pre-defined function for interacting with MySQL databases?
a. mysql_error
b. mysql_connect
c. mysql_fetch_record
d. mysql_fetch_row

Question 5
Cookies are stored on the server computer.
True
False

Question 6
Which of the following can be used to compare strings?
a. ==
b. !=
c. <=
d. all of the above

Question 7
The quantifier +, when used in a regular expression, matches any number of the preceding pattern.
True
False

Question 8
When is the body of an if statement executed?
a. when the specified condition is true
b. when the specified condition is not true
c. regardless of the specified condition
d. it depends on the body of the statement

Question 9
The setcookie function can be called:
a. Anytime during script execution.
b. During the first statement of the script only.
c. Before any other XHTML is printed.
d. None of the above.

Question 10
PHP variable names are case sensitive.
True
False

Question 11
Which is not a character class in PHP?
a. alpha
b. digit
c. numeric
d. lower

Question 12
Arrays must be indexed with which of the following data types?
a. integers only
b. either an integer or a string
c. an integer, string, or floating point number
d. either an integer or a floating point number

Question 13
The statement $$inputName is:
a. referencing a variable whose name is equal to the value of $inputName.
b. defining an array named $inputName.
c. shorthand for typing $inputName twice.
d. A syntax error.

Question 14
GET and POST data sent to a PHP script are accessible using the ________ and ________ superglobal arrays.
a. $GET, $POST
b. $GETDATA, $POSTDATA
c. $CLIENT, $SERVER
d. $_GET, $_POST

Question 15
PHP script is never in the same file as XHTML script.
True
False

Question 16
Function die never takes arguments.
True
False

Question 17
The foreach statement is designed specifically for iterating over arrays.
True
False

Question 18
The settype function only temporarily changes the type of a variable.
True
False

Question 19
The regular expression a+ matches
a. the string a+
b. a string of one or more a's
c. a string of zero or more a's
d. a string with a + at the beginning

Question 20
A cookie that lasts only until the browser is closed is called a ________ cookie.
a. session
b. persistent
c. temporary
d. timed

1. What does PHP stand for?
Personal Hypertext Processor
PHP: Hypertext Preprocessor
Private Home Page

2. PHP server scripts are surrounded by delimiters, which?
<?php>...</?>
<?php...?>
<script>...</script>
<&>...</&>

3. How do you write "Hello World" in PHP
Document.Write("Hello World");
echo "Hello World";
"Hello World";

4. All variables in PHP start with which symbol?
&
$
!

5. What is the correct way to end a PHP statement?
.
New line
</php>
;

6. The PHP syntax is most similar to:
VBScript
Perl and C
JavaScript

7. How do you get information from a form that is submitted using the "get" method?
$_GET[];
Request.QueryString;
Request.Form;

8. When using the POST method, variables are displayed in the URL:
True
False

9. In PHP you can use both single quotes ( ' ' ) and double quotes ( " " ) for strings:
True
False

10. Include files must have the file extension ".inc"
False
True

11. What is the correct way to include the file "time.inc" ?
<?php include:"time.inc"; ?>
<?php include file="time.inc"; ?>
<?php include "time.inc"; ?>
<!-- include file="time.inc" -->

12. What is the correct way to create a function in PHP?
create myFunction()
function myFunction()
new_function myFunction()

13. What is the correct way to open the file "time.txt" as readable?
fopen("time.txt","r+");
open("time.txt","read");
open("time.txt");
fopen("time.txt","r");

14. PHP allows you to send emails directly from a script
True
False

15. What is the correct way to connect to a MySQL database?
mysqli_connect(host,username,password,dbname);
mysqli_db(host,username,password,dbname);
mysqli_open(host,username,password,dbname);

16. What is the correct way to add 1 to the $count variable?
count++;
$count++;
++count
$count =+1

17. What is a correct way to add a comment in PHP?
<!--...-->
*...*
/*...*/
<comment>...</comment>

18. PHP can be run on Microsoft Windows IIS (Internet Information Server):
True
False

19. In PHP, the die() and exit() functions do the exact same thing.
False
True

20. Which one of these variables has an illegal name?
$myVar
$my_Var
$my-Var

Solution PreviewSolution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

Question 1: The answer is false.
Question 2: The answer is true.
Question 3: The answer is true.
Question 4: The answer is option B.
Question 5: The answer is false.
Question 6: The answer is option D.
Question 7: The answer is false....
$48.00 for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Web Development (HTML, XML, PHP, JavaScript, Adobe, Flash, etc.) Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats