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
disk_free_space()
[disk_free_space – Returns available space on filesystem or disk partition]
This function – when given a string containing a directory – will return the number of bytes available [‘free space’] on the corresponding filesystem or disk partition.
disk_free_space(directory_string);
[If given a file name rather than a directory, the behaviour of the function is unspecified and may differ between operating systems and PHP versions.]
disk_free_space(): returns the number of available bytes as a float on success; FALSE on failure.
disk_total_space()
[disk_total_space – Returns the total size of a filesystem or disk partition]
This function returns the total number of bytes [‘total space’] on the filesystem or disk partition specified by directory_string.
disk_total_space(directory_string);
disk_total_space(): returns the total number of bytes as a float on success; FALSE on failure.
fclose()
[fclose – Closes an open file pointer]
This function closes the file pointed to by resource_handle.
fclose(resource_handle);
[resource_handle must be valid, and must point to a file successfully opened by fopen() or fsockopen().]
fclose(): returns TRUE on success; FALSE on failure.
feof()
[feof – Tests for end of file on a file pointer]
Tests resource_handle for end-of-file.
feof(resource_handle);
feof(): returns TRUE if resource_handle is at end-of-file or an error occurs (including socket timeout); otherwise FALSE.
fflush()
[fflush – Flushes the output to a file]
This function forces a write of [‘flushes’] all buffered output to the resource pointed to by file_handle.
fflush(file_handle);
[file_handle must be valid, and must point to a file successfully opened by fopen() or fsockopen() and not yet closed by fclose().]
fflush(): returns TRUE on success; FALSE on failure.
fgetc()
[fgetc – Gets character from file pointer]
This function gets a character from file_pointer. Use the === operator to test the return value of this function.
fgetc(file_pointer);
fgetc(): returns a string containing a single character read from file_pointer on success; FALSE on end-of-file.
fgetcsv()
[fgetcsv – Gets line from file pointer and parses for CSV fields]
This locale-aware function parses the line it reads [‘gets’] from file_pointer for fields in CSV format and returns an array containing the fields read.
[length is an optional parameter, with a default value of 0. Allowing for trailing line-end characters, length must be greater than the longest line (in characters) to be found in the CSV file; otherwise the line is split into chunks of length characters, unless the split would occur inside an enclosure. delimiter is an optional single-character parameter, with a default value of “,“. enclosure is an optional single-character parameter, with a default value of ‘“”‘. escape is an optional parameter, with a default value of “\\“.]
fgetcsv(): returns an indexed array of the values read. A blank line in a CSV file will be returned as an array comprising a single null field, rather than being treated as an error. If an invalid file_pointer is specified, NULL is returned; for all other errors – including end-of-file – FALSE is returned. Enabling the auto_detect_line_endings run-time configuration option may help to resolve the issue of PHP not properly recognizing line endings when reading files either on or created by a Macintosh computer.
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.