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
fscanf()
[fscanf – Parses input from a file according to a format]
This function takes its input [‘scans’] from a file associated with file_pointer and interprets the input according to format. Each call to fscanf() reads one line from the file, and any whitespace in the format string matches any whitespace in the input stream.
fscanf(file_pointer, format, args[optional parameter – the optional, assigned values]);
fscanf(): returns an array of the values parsed if only two parameters were passed to this function; if optional parameters are passed, the number of assigned values will be returned. The optional parameters must be passed by reference.
fseek()
[fseek – Seeks on a file pointer]
This function sets the file position indicator for the file referenced by file_pointer. The new position is obtained by adding offset to the position specified by whence, and is measured in bytes from the beginning of the file. Although generally allowed, certain streams may not support seeking past end-of-file [EOF]. If data is written after seeking past EOF, reads in any unwritten region between EOF and the sought position will yield bytes with value 0.
fseek(file_pointer, offset, whence[optional parameter, with a default value of SEEK_SET]);
[offset: to move to a position before EOF, a negative value is required for offset and whence must be set to SEEK_END. whence possible values: SEEK_SET [set position equal to offset bytes]; SEEK_CUR [set position to current location plus offset]; and SEEK_END [set position to EOF plus offset].]
fseek(): returns 0 on success; -1 on failure.
fstat()
[fstat – Gets information about a file using an open file pointer]
This function collects the statistics of the file opened by file_pointer. It is similar to the stat() function, but operates on an open file pointer rather than a filename.
Will not work on remote files, since the file under examination needs to be accessible via the server’s filesystem.
fstat(file_pointer);
fstat(): returns an array with the statistics of the file. The array elements [numeric/associative] comprise: device number [0/dev]; inode number [1/ino]; inode protection mode [2/mode]; number of links [3/nlink]; userid of owner [4/uid]; groupid of owner [5/gid]; device type, if inode device [6/rdev]; size in bytes [7/size]; time of last access (Unix timestamp) [8/atime]; time of last modification (Unix timestamp) [9/mtime]; time of last inode change (Unix timestamp) [10/ctime]; blocksize of filesystem IO [11/blksize]; and number of 512-byte blocks allocated [12/blocks].
ftell()
[ftell – Returns the current position of the file read/write pointer]
This function returns [‘tells’] the position of file_pointer.
ftell(file_pointer);
ftell(): returns the position (as byte-based offset into the file stream) of file_pointer.
ftruncate()
[ftruncate – Truncates a file to a given length]
This function truncates the file referenced by file_pointer to size.
ftruncate(file_pointer, size);
[size: if larger than file_pointer then the file is extended with null bytes; if smaller than file_pointer then the file is truncated to that size.]
ftruncate(): returns TRUE on success; FALSE on failure.
fwrite()
[fwrite – Binary-safe file write]
This function – an alias of fputs() – writes the contents of string to the file stream pointed to by file_pointer.
[If the length argument is given, writing will stop once length bytes have been written, or the end of string is reached [whichever comes first]. Also, the magic_quotes_runtime configuration option will be ignored and no slashes will be stripped from string.]
fwrite(): returns the number of bytes written on success; FALSE on failure.
glob()
[glob – Find pathnames matching a pattern]
This function searches for all the pathnames [thus, a global search] matching pattern according to the rules used by the libcglob() function, which is similar to the rules used by common shells.
glob(pattern, flags[optional parameter]);
[With regard to pattern, no tilde expansion or parameter substitution is done. The following values can be used as the flags parameter: GLOB_MARK; GLOB_NOSORT; GLOB_NOCHECK; GLOB_NOESCAPE; GLOB_BRACE; GLOB_ONLYDIR; and GLOB_ERR.]
glob(): returns an array containing the matched files or directories, or an empty array if no file matched; FALSE on error.
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.