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
stat()
[stat – Gives information about a file]
This function collects the statistics pertaining to the file specified by filename. If filename is a symbolic link, statistics relate to the file itself, not the symlink; lstat() is identical to stat() except that its statistics would pertain to the symlink‘s status.
stat(filename);
stat(): returns an array of statistics pertaining to filename, as detailed in relation to fstat() above. Additional notes on the array elements returned by this function are: inode number [1/ino], userid of owner [4/uid], and groupid of owner [5/gid] will always be 0 on Windows platforms; blocksize of filesystem IO [11/blksize] and number of 512-byte blocks allocated [12/blocks] are only valid on systems supporting the st_blksize type — other systems (including Windows) return -1. FALSE is returned and an E_WARNING is emitted upon failure.
symlink()
[symlink – Creates a symbolic link]
This function creates a symbolic link to the existing target with the specified name link.
symlink(target, link);
symlink(): returns TRUE on success; FALSE on failure. Regarding Windows performance: this function will only work if the system you run PHP from is Windows Vista/Windows Server 2008 or newer; prior Windows versions do not support symbolic links.
tempnam()
[tempnam – Create file with unique file name]
This function creates a file with a unique temporary filename – with access permission set to 0600 – in the specified directory. This function may generate a file in the system’s temporary directory – and return the full path to that file, including its name – if directory does not exist or is not writable.
tempnam(directory, prefix);
[prefix represents the prefix of the generated temporary filename. Only the first three characters of prefix are used on Windows platforms.]
tempnam(): returns the new temporary filename (with path) as a string on success; FALSE on failure. If you no longer require the created file you must remove it manually, it is not removed automatically. If PHP cannot create the file in the specified directory, it falls back on the system default. This also happens on NTFS if the specified directory contains more than 65534 files.
tmpfile()
[tmpfile – Creates a temporary file]
This function creates a temporary file with a unique name in read-write mode [‘w+’], and returns a file handle. The file is automatically removed when 1.) fclose() is called, or 2.) there are no remaining references to the file handle, or 3.) the script ends. For further details, consult your system documentation on the tmpfile(3) function, as well as the stdio.h header file.
tmpfile();
tmpfile(): returns a resource handle for the new file on success (similar to the one returned by fopen()); FALSE on failure.
touch()
[touch – Sets access and modification time of file]
This function attempts to set the access and modification [‘touch’] times of the file named in filename to the value given in time. Regardless of the number of parameters, the access time is always modified.
The file will be created if it does not already exist.
touch(filename, time[optional parameter, with a default value of time()], atime[optional parameter]);
[atime: the access time of filename is set to atime, if present. Otherwise, it is set to the value passed in time. The current system time is used if neither value is present.]
touch(): returns TRUE on success; FALSE on failure. Prior to PHP 5.3.0 it was not possible to change the modification time of a directory with this function on Windows platforms.
umask()
[umask – Changes the current umask]
This function sets PHP’s umask to mask & 0777, and returns the old umask. When PHP is being used as a server module, the umask is restored when each request is finished.
umask(mask[optional parameter]);
[If mask is not supplied, the current umask is returned.]
umask(): if mask is present, the old umask is returned; if mask is absent, the current umask is returned.
unlink()
[unlink – Deletes a file]
This function deletes [‘un–links’] filename; similar to the Unix Cunlink() function.
unlink(filename, context[optional parameter]);
unlink(): returns TRUE on success; FALSE and an E_WARNING on failure.
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.