PHP and MySQL Web Development: Chapters 4, 5, & 6 Quiz
Which of the following PHP expressions can get the domain name from a customer's email address?
$email_array = explode('@', $email);
Which of the following represents the HTML encoding of >?
>
What is the most common delimiter in PCRE regular expressions?
/
What is the result of the statement echo strlen("hello");?
5
________ are methods, actions, or functions that an object can perform to modify itself or perform some external effect.
Operations
Which of the following programming languages does NOT support true multiple inheritance?
PHP
Which of the following statements is true concerning PHP functions?
PHP function names cannot begin with a digit.
The expression $test = substr_replace($test, 'X', -1); replaces:
The last character in $test
Which of the following regex tokens anchors your match to the beginning of the subject string?
^
Calls to PHP functions:
are case-insensitive
In object-oriented programming, ________ are properties or variables that relate to an object.
attributes
Which of the following is a php.ini directive that points to a header file?
auto_prepend_file
Which of the following conversion specification type codes interprets as an integer and prints as a character?
b
The PHP statement $a = new classname("First"); denotes a(n):
constructor
Use the ________ keyword to specify that one class is to be a subclass of another.
extends
Which of the following shows the correct use of the final PHP keyword?
final function operation() {}
The trim() function removes whitespace:
from the start and end of a string
You create methods by declaring ________ within a PHP class definition.
functions
PHP variables that are declared inside a function are known as:
local variables
Which PHP function takes a string as a parameter and replaces all the newlines in it with the HTML <br /> tag?
n12br()
What is the role of 'foo' in the PHP statement function('foo');?
parameter
In PHP, the normal way that function parameters are called is known as:
pass by value
The object-oriented principle of ________ means that different classes can have different behaviors for the same operation.
polymorphism
A PHP function's ________ lists its parameters and data types.
prototype
What is the default PHP class access modifier?
public
A PHP function that calls itself is known as a ________ function.
recursive
Which of the following is a PHP statement that allows you to load a file into your PHP script?
require()
Which of the following is an alias for the chop() PHP function?
rtrim()
The PHP keyword return:
stops the execution of a function
In a PHP ________, you can group together functionality that may be reused in multiple classes.
trait