PHP Welling 1-5
Calls to PHP Functions:
are case-insensitive
How does the PHP engine process whitespace?
Ignores it
Which of the following fopen() file modes denotes 'cautious write'?
X
What is the most common delimiter in PCRE regular expressions?
/
Which of the following symbol represents a single-line comment in PHP?
//
PHP indexes start at ________ by default.
0
In PHP writing data to a file requires how many steps?
3
What is the result of the statement echo strlen("hello");?
5
Which of the following is an example of a short-style PHP tag?
<? echo '<p>Order processed.</p>'; ?>
Which of the following PHP data types stores only true or false values?
Boolean
Which of the following conversion specification type codes interprets as an integer and prints as a character?
C
Which of the following is a PHP function used to declare constants?
Define
Which of the following represents a reading lock of the flock() function?
LOCK_SH
An array containing other arrays is known as a(n) ___________ array.
Multidimensional
In PHP which bitwise operation is signified by the pipe (|) character?
OR
Which of the following statements is true concerning PHP functions?
PHP function names cannot begin with a digit.
What is the role of 'foo' in the PHP statement function('foo');?
Parameter
A PHP function's __________ lists its parameters and data types.
Prototype
MySQL is an example of a(n):
RDBMS
What kind of PHP variable stores a single value?
Scalar
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?
^
PHP string interpolation requires:
double quotation marks
In PHP a while loop tests for the end of the file by using which function?
feof()
To open a file in PHP you use the _________ function
fopen()
The _________ function reads an arbitrary number of bytes from a file.
fread()
The trim() function removes whitespace:
from the start and end of a string
The three different PHP sorting functions are sort() asort(), and
ksort()
The __________ construct can be used to split an array into a number of values.
list()
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()
In PHP the normal way that function parameters are called is known as:
pass by value
Disable PHP from opening files via fopen() and FTP by editing:
php.ini
Which of the following is a PHP statement that allows you to load a file into your PHP script?
require()
The PHP keyword return:
stops the execution of a function
Which of the following PHP array operators signifies non-identity?
!==
Which of the following statements is false concerning PHP identifiers?
Identifiers are case insensitive.
Which of the following statements tests for equality between the PHP variables $a and $b?
$a == $b
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 expression shows a correct PHP array definition?
$products = ['Tires', 'Oil', 'Spark Plugs'];
Which of the following represents the HTML encoding of >?
>
The statement $products{0} access the ________ element in an array.
First
A PHP function that calls itself is known as a _________ function.
Recursive
The PHP constant ____________ will sort an array as strings depending on the current locale.
SORT_LOCALE_STRING
Which of the following is NOT a problem of working with flat files in PHP?
When a file becomes small, working with it can be very slow
The _________ function modifies every element in an array the same way.
array_walk()
Which of the following is a php.ini directive that points to a header file?
auto_prepend_file
Which of the following is an alternative to the PHP file_put_contents() function?
fwrite()
Which of the following is an alias for the chop() PHP function?
rtrim()
What is the purpose of the semicolon in PHP?
statement termination