Find study materials for any course. Check these out:
Browse by school
Make your own
To login with Google, please enable popups
To login with Google, please enable popups
Don’t have an account?
To signup with Google, please enable popups
To signup with Google, please enable popups
Sign up withor
Autoglobal array elements are referred to with an index number.
You must use the global keyword to reference a global variable within the scope of a function.
When using the variable name as an index for the $GLOBALS array, you omit the leading dollar sign from the name.
The method attribute defines how the form data is submitted to the server.
The value of the method attribute will be either post or get.
When the form data is submitted using the get method, the form data is appended to the URL specified in the form’s method attribute.
When a form’s submit button is pressed, each field on the form is sent to the Web server as a name/value pair.
When the post method is used to submit a form, the name portion of the name/value pair becomes the value assigned to the array element.
When using the get method to submit form data, the form data is separated from the URL by a colon. (:).
The get method restricts the number of characters that can be appended to a URL to 255.
PHP includes a feature called magic quotes, which automatically adds a backslash (\) to any single quote, double quote, or NULL character in submitted form data.
By default, magic_quotes_gpc is the only magic quote directive enabled in the php.ini configuration file.
The alternate method to escape strings is the stripslashes() function.
The blank() function can be used to determine if a value was entered in a form.
The best way to ensure valid form data is to build the Web form with controls that only allow the user to enter acceptable responses
The round() function can be used to ensure that numbers have the appropriate number of digits after the decimal point, if any.
Regular expression functions are some of the best tools for verifying string data meets the strict formatting required for email addresses.
A good programming practice is to stop processing a form when an error is found and display the error to the user.
A sticky form is redisplayed with the values that the user entered the last time the form was submitted.
With complex escaping from XHTML, you close one PHP block, insert some XHTML elements, and then open another PHP block to continue the script.
In PHP, an e-mail message is sent using the email() function.
The subject argument of the mail function must be plain text without XHTML tags or character entities.
From, Cc, Bcc and Date headers are examples of additional headers.
The mail() function returns a value of TRUE if the message was sent successfully and FALSE if it was not.
In an all-in-one form, when the user clicks the submit button, the script submits the form to a separate processing script.
The issent() function can be used to determine if the $Submit variable has been set (if the Submit button has been pressed).
The unset() function is used to uninitialize a variable after it has been set.
The post method is ideal for embedding options in a hyperlink.
When using text hyperlinks to navigate within a Web page template, the values that specify which dynamic content to show must be appended to the filename in the “href” attribute of the anchor tag.
You cannot use buttons to target content to a dynamic section of a Web page template.
Autoglobals or superglobals are predefined ____.
Autoglobals are associative arrays whose elements are referred to with a(n) ____ key instead of an index number.
The $_ENV autoglobal contains ____ variables that programs use to interact with the system.
The ____ function displays the elements of the $_ENV array and their values.
You can use ____ autoglobal array to refer to the global version of a variable from inside a function.
The value of the ____ attribute identifies the program on the Web server that will process the form data when the form is submitted.
When you click a form’s submit button, each field on the form is sent to the Web server as a ____ pair.
When you use the ____ method to submit form data to the processing script, the form data is appended to the URL specified by the action attribute.
The PHP feature that automatically adds a backslash to any single quote, double quote, or NULL character contained in form data that a user submits to a PHP script is ____.
The ____ function is used to reverse the changes made by magic quotes or the addslashes() function.
The ____ function can be used to determine if a variable contains values.
The ____ function can be used to ensure that a number has the appropriate number of decimal places.
A form that contains the values that a user previously entered in the form is called a ____ form.
In PHP, a(n) e-mail message is sent using the ____ function.
Which of the following is NOT a required argument of the mail() function?
The two simplest forms of the ____ are the plain e-mail address and the recipient’s name followed by the e-mail address in angle brackets.
The additional_headers argument needs to be formatted to conform to the syntax of headers in the ____ documentation.
A ____ form contains one page that displays the Web form and one page that process the form data.
A Web page ____ is a single Web page that is divided into sections
PHP scripts that are included in a Web template often begin with a prefix of ____.
If the content of a Web page template section does not change unless the include file is modified, it is called a ____ section.
The script in the dynamic data section of the Web page template will check the value of the ____ array to determine which page to display, assuming the name being passed is ‘page’.
When using form image buttons, each button requires a unique ____ for the name attribute..
The ____ autoglobal can be used to access the result from form data sent with both the get and post methods.
There are security risks using the $_REQUEST autoglobal because it includes the contents of the ____ autoglobal as well as the $_GET and $_POST autoglobals.
PHP recognizes two types of files: binary and text.
You append the \n carriage return escape sequence to the end of a line to identify the end of a line on a UNIX/Linux platform.
PHP provides the chper() function for changing the permission of a file from within PHP.
The three levels of permissions for files and directories are Read, Write, and Delete.
The three levels of access for files and directories are User, Group, and Other.
The fileperms() function allows the user to read the permissions associated with a particular file.
The chdir() function changes to the name of the specified directory.
A handle is a special type of variable that PHP uses to represent a resource, such as a file or directory.
You can use the opendir() function to return the file and directory names from the open directory.
The directory pointer is a way of keeping track of where you are in a directory.
The scandir() function returns an indexed array containing the names of files and directories in a specified directory.
The scandir() function sorts the returned entries in the order in which they are stored by the operating system.
You use the createDir() function to create a new directory.
The file_exists() function determines whether a file or directory exists.
An additional form attribute, enctype, with a value of "multipart/form-data" must be used to upload files.
You can specify the maximum size of an uploaded file using MAX_FILE SIZE as a hidden input field below the file input field.
The move_uploaded_file() function moves the uploaded file from its temporary location to the permanent destination.
The file_write_contents() function writes a text string as a file.
Both the echo() and print() statements send data to an input stream.
You use the fopen() function to open a handle to a file stream.
The a+ mode argument opens the specified file for reading only and places the file pointer at the beginning of the file.
If you want to open a file for reading and writing and place the file pointer at the end of the file, you use a mode argument of “a+”.
When you are finished with a file stream, you use the statement fopen($handle); to ensure that the file doesn’t keep consuming space in your computer’s memory.
You can use the fwrite() function to incrementally write data to a text file.
You would use the file_put_contents() function to quickly replace the contents of a file or append data to the end of an existing file.
To prevent multiple users from modifying a file simultaneously, you need to use the file_lock() function.
The syntax for the copy_file() function is copy_file(source, destination).
You can use the delete() function to delete files.
Some operating systems always list two directory entries named “.” and “..”, which refer to the current directory and the directory that contains the current directory.
One way to move a file in PHP is to copy with file with the copy() function, and then delete the original file with the unlink() function.
On a Macintosh platform, you append the ____ carriage return escape sequence to the end of the line.
The second digit in the file permission code assigns permissions to the ____.
The ____ function returns an indexed array containing the names of files and directories in the specified directory.
When a form is posted, information from the uploaded file is stored in the ____ autoglobal array.
The ____ function writes a text string and creates the file if it does not exist.
The ____ constant instructs PHP to append data to any existing contents in a specified filename instead of overwriting it.
When a text file contains a single block of text, the ____ function would read the entire contents of the file into a string.
The ____ function reads the contents of a text file that stores each individual line as an element of an indexed array.
Using a value of ____ for the mode argument of the fopen() function opens the specified file for reading and writing and places the file pointer at the end of the file.
When you are finished working with a file stream, you use the ____ function to ensure that the file does not keep taking up space in your computer’s memory.
Because the fopen() function must be used with the ____ function, you can specify what type of operations can be performed on the file and where and how the data will be written.
The ____ argument of the fwrite() function allows you to specify the maximum number of bytes that should be written.
The operational constant of the flock() function that opens the file with an exclusive lock for writing is the ____.
Instead of reading a large text file into PHP, you can use the ____ to iterate through a text file.
Every time you use the ____ function, the file pointer moves to the next character in the file.
What function returns a line and moves the file pointer to the next line?
What function returns a line that ends with a specified delimiter and moves the file pointer to the next line?
What function returns a line, strips any XHTML tags the line contains, and then moves the file pointer to the next line?
With the exception of the ____ function, each time you call a function that iterates through a text file, the file pointer automatically moves to the next line in the text file.
What function returns a value of true when the file pointer reaches the end of the file?
Two arguments, source and destination, are used with the ____ function.
The two arguments required for the rename() function are ____.
What function is used to delete files?
The ____ function should be used before deleting files and directories to determine if the file or directory name exists.
What function is used to copy the names of the files in a directory to an array?
The ____ function only works when there are “.” and “..” are the only two entries present in a directory.
The array_shift() function adds one or more elements to the beginning of an array.
You use the array_unshift() function to remove the first element from the beginning of an array.
The last element is removed from the end of an array using the array_pop() function.
The array_push() function adds one or more elements to the end of an array.
The array_splice() function adds or removes array elements located anywhere in an array.
The array_name argument in the array_splice() function indicates the name of the array you want to eliminate.
Aside from its main function, the array_splice() function also renumbers the indexes in the array.
You can use the unset() function to remove array elements and other variables.
One problem with the unset() function is that is does not renumber the remaining elements in the array.
To remove an indexed array’s elements, you need to run the array_values() function.
The array_unique() function removes elements that are unique to an array.
The array_values() function operates directly on an array.
The array_unique() function does not renumber the indexes after removing duplicate values in an array.
PHP creates indexed arrays by default with a starting element of 0.
With associative arrays, you can use any alphanumeric keys that you want for the array elements.
If you create an associative array and then add a new element without specifying a key, PHP will not assume that the array is indexed.
The internal array pointer is a special type of variable that refers to the currently selected element in an array.
The internal array pointer is a way of keeping track of which element you are working with in an array.
If you use an iteration function to move the internal array pointer either before the first element or after the last element in an array, the only way to move the array pointer back to a valid element is to use the unset() function.
The in_array() function returns a Boolean value of TRUE if a value exists in an array.
The array_search() function determines whether a given value exists in an array and returns the negative value of the first matching element is it exists or false if it does not exist.
The array_key_exists() function determines whether a given index or key exists.
Use the array_keys() function to return an indexed array containing all the keys in an associative array.
Use the array_slice() function to return or copy a portion of an array and assign it to another array.
The most commonly used array sorting functions are sort() and rsort() for associative arrays.
Instead of appending one array to another you can merge two or more arrays with the array_merge() function.
The array_diff() function returns an array of elements that exist in one array but not in any other arrays to which it is compared.
You refer to the values in a multidimensional indexed array by including two sets of brackets, one which refers to the row and one which refers to the column.
To have PHP store form data in an array, you modify the name attribute of the input element to use array notation.
PHP stores form data in an indexed array but cannot store form data in an associative array.
The array_shift() function removes the ____ element from the beginning of an array.
The array_unshift() function adds ____ element(s) to the beginning of the array.
The array_pop() function ____ from the end of the array.
The array_push() function ____ one or more elements to the end of the array.
The ____ function lets you add or remove elements anywhere else in the array.
The ____ argument of the array_splice() function indicates the name of the array you want to modify.
To remove multiple elements using the unset() function, separate each ____ name with commas.
To renumber an indexed array’s elements, you need to run the ____ function.
The ____ function removes duplicate elements from an array.
The ____ is a special type of variable that refers to the currently selected element in an array.
The ____ function returns a Boolean value of true if a given value exists in the array.
The ____ function determines whether a given index or key exists.
You use the ____ function to return a portion of an array and assign it to another array.
To sort an associative array by key, use the ____ function.
To perform a reverse sort on an associative array by key and maintain the existing keys, use the _____ function.
The symbol ____ appends one array to another.
Merge two or more arrays with the ____ function.
The ____ function returns an array of elements that exist in one array but not in any other arrays to which it is compared.
You can create ____ that consist of multiple indexes or keys.
The most common type of multidimensional array is a(n) ____ array.
A multidimensional array in PHP is essentially ____.
Multidimensional arrays are not limited to ____.
The data values for input elements that use array notation for the value of the name attribute are stored in a ____ array within the $_POST autoglobal array.
If there are no indexes or keys entered in the value of the name attribute in a form, PHP assigns an index of ____ to the first element.
Sign up for free and study better.
Get started today!