Clicking the ‘randomize’ button situated above the reference table generates a new table whereby the function descriptions, function syntaxes, and function return values are randomized. The quiz involves matching the function descriptions, function syntaxes, and function return values to the correct function name. Information relating to the randomization of table cells will be displayed for three seconds, before disappearing.
On a desktop computer, table elements are selected by left-clicking the desired table cell and holding the left click in the mouse down position for one second before releasing the left click. The text inside the table cell will turn red to indicate that the one-second mouse left-click has successfully selected a table cell. To then swap the selected table cell with the target table cell, simply repeat the one-second left mouse-click process on the target cell; the table cells will swap position. To de-select a table cell, simply repeat the one-second left mouse-click process on the original table cell.
To select a table element on a touchscreen device (mobile, tablet), simply touch the desired table cell and maintain the touch for one second before removing your finger from the screen. The text inside the table cell will turn red to indicate that the one-second touch has successfully selected a table cell. To then swap the selected table cell with the target table cell, simply repeat the one-second touch process on the target cell; the table cells will swap position. To de-select a table cell, simply repeat the one-second touch process on the original table cell.
Normal touchscreen scrolling behaviour is exhibited by the cells with a light green background; cells without a light green background will not respond to normal touchscreen scrolling. The table is positioned in such a way that the user can also initiate touchscreen scrolling by swiping to the right or left of the table.
When a row consists of the correct function name, function description, function syntax, and function return value, the background colour of the row will change from ‘transparent’ to ‘khaki’; this provides visual feedback that the row is complete.
Once the entire table is complete, a paragraph of feedback will congratulate the user and provide the following information: date and time of quiz commencement; date and time of quiz completion; and the length of time it took the user to complete the quiz.
VIEWPORT OPTIONS:
An example of the layout designed for mobile phonesAn example of the layout designed for tabletsAn example of the layout designed for desktop computers
PURPOSE:
This webpage serves two purposes:
It provides a reference table for the PHP filesystem functions, with information extracted and condensed from w3schools.com, phptutorial.info and php.net.
It enables users to complete a quiz related to the PHP filesystem functions.
USAGE:
For each filesystem function there are four table cells of information: the function name; the function description; the function syntax; and the function return value. There are three layouts available – ‘mobile‘, ‘tablet‘, and ‘desktop‘.
Click the relevant button below to display the PHP filesystem functions reference table, sized appropriately for the desired viewport. A ‘RANDOMIZE‘ button appears above the reference table once the viewport is selected; clicking this button facilitates the commencement of a quiz.
Click the ‘RANDOMIZE‘ button to randomize the functional descriptions, the functional syntaxes, and the functional return information.
FUNCTION NAME
FUNCTION DESCRIPTION
FUNCTION SYNTAX
FUNCTION RETURN VALUE
basename()
[Returns trailing name component of path]
This function returns the trailing name component [‘base name’] of the path to a file or directory specified in path_string. basename() is not aware of the actual filesystem, although it is locale-aware.
basename(path_string, suffix[optional parameter – if the name ends in ‘suffix’ this will also be cut off]);
[path_string: on Windows systems, both forward slashes and backslashes can be used as directory separators; on other systems it is only the forward slash.]
basename(): returns the base name of the given path_string.
chgrp()
[Changes file group]
This function attempts to change the group of the file filename to group. The superuser may change the group of a file arbitrarily; other users may change the group of a file to any group of which that user is a member.
chgrp(filename, group);
chgrp(): returns TRUE on success, FALSE on failure.
chmod()
[Changes file mode]
Attempts to change the mode of the file specified in filename to that given in mode.
chmod(filename, mode);
[The mode parameter must be prefixed by a 0. Execute [1], write [2], and read [4] rights can be specified for the owner, the user group of the owner, and for everybody else – in that order.]
chmod(): returns TRUE on success, or FALSE on failure.
chown()
[Changes file owner]
This function attempts to change the owner of filename to user. Only the superuser is permitted to change the owner of a file.
chown(filename, user);
chown(): returns TRUE on success; FALSE on failure.
clearstatcache()
[Clears file status cache]
PHP caches the information returned by certain functions in order to provide speedier performance. The functions for which the information is cached are: stat(), lstat(), file_exists(), is_writable(), is_readable(), is_executable(), is_file(), is_dir(), is_link(), filectime(), fileatime(), filemtime(), fileinode(), filegroup(), fileowner(), filesize(), filetype() and fileperms(). If you are performing multiple operations on the same filename and require the information to not be cached, use clearstatcache().
clearstatcache(clear_realpath_cache[optional parameter, default value of FALSE], filename [only used if clear_realpath_cache() is TRUE]);
clearstatcache(): no value is returned.
copy()
[copy – Copies file]
This function makes a copy of the file source to destination. In order to move a file, use the rename() function.
[source is a string specifying the path to the source file. destination specifies the destination path. If this destinationstring is a URL, the copy operation may fail if the wrapper does not support the overwriting of existing files. If the destination file already exists, it will be overwritten.]
copy(): returns TRUE on success; FALSE on failure.
dirname()
[dirname – Returns a parent directory’s path]
When passed a string containing the path of a file or directory, this function will return the parent directory’s path [‘name’] that is levels up from the current directory. This function is locale-aware, so the matching locale must be set with setlocale() for it to see the correct directory name with multibyte character paths.
dirname(path, levels[optional parameter]);
[levels specifies the number of parent directories to go up. This must be an integer greater than 0; the default value is 1.]
dirname(): returns the path of a parent directory. If there are no slashes in path, a dot (.) is returned – indicating the current directory. Otherwise, the returned string is path with any trailing /component removed.
FILL IN FORM AND CLICK SUBMIT TO ADD YOUR STATISTICS TO THE LEADERBOARD:
Forty-year-old father of three wonderful children [William, Seth, and Alyssa]. Works as an Assistant Technical Officer in the Sterile Services Department of Treliske Hospital, Cornwall. Enjoys jogging, web design, learning programming languages, and supporting Arsenal FC. Obtained a BA degree in English from the University of Bolton in 2008, and has continued to gain qualifications in a diverse range of subjects thereafter.