PHP Chapter 1

Ace your homework & exams now with Quizwiz!

unary operator

A ________ requires a single operand either before or after the operator. For example, $count++.

does not require data types of variables to be declared

A loosely typed programming language _____. a. does not require data types of variables to be declared b. requires data types of variables to be declared c. does not have different data types d. does not have variables

True

Array elements are separated by commas. True or False

zero

Array elements start with an index number of ______.

*/

Block comments begin with /* and end with _____. a. */ b. /* c. // d. **

*/

Block comments start with /* and end with _____

uppercase

By convention, constant names use all _______ letters.

zero (0)

By default, indexes begin with the number_______ .

// #

Comments in PHP can start with ______ or _______

primitive types

Data types that can be assigned only a single value are called _______.

4 types of tags

Default syntax <?php ?> Short open Tags <? ?> HTML Script Tags <script> </script> ASP Style Tags <% %>

echo & print

Examples of language constructs.

zero

How many decimal places does an integer store? a. zero b. one c. two d. as many as necessary

True

In PHP, you must declare and initialize a variable in the same statement.

case insensitive

Unlike XHTML and JavaScript, programming language constructs, functions and keywords in PHP are mostly _______

define()

Use the _______ function to create a constant

case sensitive

Variables are ______ .

comma

What character or characters are used as delimiters to separate multiple arguments (parameters) in a function declaration or function call?

a comma (,)

What do you use to separate multiple arguments that are passed to a function? a. a period (.) b. a comma (,) c. a forward slash (/) d. a backwards slash (\)

.php

What is the default extension that most Web servers use to process PHP scripts? a. .php b. .html c. .xhtml d. .ini

20

What is the value of the expression 4 * (2 + 3)? a. 11 b. -11 c. 20 d. 14

false

What value is assigned to the $ReturnValue variable in the statement $ReturnValue = !$x;, assuming that $x has a value of true? a. true b. false c. null d. undefined

true

What value is assigned to the $ReturnValue variable in the statement $ReturnValue = 100!= 200;? a. true b. false c. 100 d. 200

a. ++ b. --

Which arithmetic operators can be used as both prefix and postfix operators? (Choose all that apply.) a. ++ b. -- c. + d. -

$MyVariable = "Hello";

Which is the correct syntax for declaring a variable and assigning it a string? a. $MyVariable = "Hello"; b. $MyVariable = "Hello" c. "Hello" = $MyVariable; d. $MyVariable = Hello;

$SalesOrder

Which of the following is a valid variable name? a. SalesOrder b. salesOrder c. $SalesOrder d. $1SalesOrder

$Employees[0]

Which of the following refers to the first element in an indexed array named $Employees[]? a. $Employees[0] b. $Employees[1] c. $Employees[first] d. $Employees[a]

a. true b. false

Which of the following values can be assigned to a Boolean variable? (Choose all that apply.) a. true b. false c. 1 d. yes

False

You are not required to initialize a variable when you first declare it. True or False?

unlimited

You can include _____ code blocks of PHP script sections as you want within a document. However, when you include multiple script sections in a document, you must include a separate code declaration block for each section.

c. # d. //

You create line comments in PHP code by adding to a line you want to use as a comment. (Choose all that apply.) a. || b. ** c. # d. //

Reference

________ or composite data types, which contain multiple values or complex types of information

programming language construct

built-in feature of a programming language

embedded languages

The Web server sends the file to the scripting engine for processing. (javascript and php)

count()

The _______ function is used to determine the number of elements in an array.

the left operand and right operand both return a value of true

The And operator (&&) operator returns true if _____. a. the left operand returns a value of true b. the right operand returns a value of true c. the left operand and right operand both return a value of true d. the left operand and right operand both return a value of false

False

The last element when defining an array(), should be followed by a comma. True or False

divides two operands and returns the remainder

The modulus operator (%) _____. a. converts an operand to base 16 (hexadecimal) format b. returns the absolute value of an operand c. calculates the percentage of one operand compared to another d. divides two operands and returns the remainder

operator precedence

The order of priority in which operations in an expression are evaluated is known as _____. a. prerogative precedence b. operator precedence c. expression evaluation d. priority evaluation


Related study sets

Chapter 23 Study Guide - Nation Building and Economic Transformation in the Americas, 1800-1890 - The Earth and Its Peoples Third (3rd) Edition

View Set

Sequences and Summation Notation

View Set

4.4 Vocabulaire: Les Contes, Les Légendes, et Les Fables

View Set

Midterm - Leadership, Function, Culture, Role development, Transition (Ch 1, 2, 3, 25)

View Set

Mental Benefits and Understanding Motivation

View Set

Juvenile Law IC 31-30-1-1 Exclusive Original Jurisdiction

View Set