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 miscellaneous functions, with information extracted and condensed from w3schools.com and php.net.
It enables users to complete a quiz related to the PHP miscellaneous functions.
USAGE:
For each PHP miscellaneous 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 miscellaneous 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
php_check_syntax()
[php_check_syntax – Check the PHP syntax of (and execute) the specified file]
This function tests filename for scripting errors, performing a syntax (lint) check. It is similar to using php -l from the command line, except that this function executes – but doesn’t output – the checked filename. If a function is defined in filename it will be available to the file that called php_check_syntax(), but output from filename will be suppressed. This function has been deprecated and removed from PHP for technical reasons — to obtain the functionality provided by this function, use php -l somefile.php from the commandline instead.
[If error_message is used, it will contain the error message produced by the syntax check. error_message is passed by reference.]
php_check_syntax(): returns TRUE if the lint check passes; FALSE if the lint check fails or if filename cannot be opened.
php_strip_whitespace()
[php_strip_whitespace – Return source with stripped comments and whitespace]
This function returns the PHP source code in filename with PHPcomments and whitespace removed [‘stripped’]. This is similar to using php -w from the commandline. This function respects the value of the short_open_tagini directive.
php_strip_whitespace(filename);
[The stringfilename represents the path to the PHP file.]
php_strip_whitespace(): returns the stripped source code as a string on success; an empty string on failure. Before PHP 5.0.1, this function would only return an empty string.
sapi_windows_cp_conv()
[sapi_windows_cp_conv – Convert string from one codepage to another]
This function converts subjectstring from one codepage to another.
[in_codepage: the codepage of the subject string — either the codepage name or identifier. out_codepage: the codepage to convert the subject string to — either the codepage name or identifier. subject represents the string to convert.]
sapi_windows_cp_conv(): returns subject string converted to out_codepage, or NULL on failure. If invalid codepages are given OR if the subject is not valid for in_codepage, this function issues E_WARNING-level errors.
sapi_windows_cp_get()
[sapi_windows_cp_get – Get process codepage]
This function returns [‘gets’] the identifier of the codepage of the current process.
sapi_windows_cp_get(kind);
[kind denotes the type of codepage and can be either ‘ansi’ or ‘oem’.]
sapi_windows_cp_get(): returns the codepage identifier.
sapi_windows_cp_is_utf8()
[sapi_windows_cp_is_utf8 – Indicates whether the codepage is UTF-8 compatible]
This function indicates whether the codepage of the current process is UTF-8 compatible.
sapi_windows_cp_is_utf8();
sapi_windows_cp_is_utf8(): returns whether the codepage of the current process is UTF-8 compatible, as a boolean.
sapi_windows_cp_set()
[sapi_windows_cp_set – Set process codepage]
This function sets the codepage of the current process.
sapi_windows_cp_set(codepage);
[codepage represents a codepage identifier; integer format.]
sapi_windows_cp_set(): returns TRUE on success; FALSE on failure.
sapi_windows_vt100_support()
[sapi_windows_vt100_support – Get or set VT100 support for the specified stream associated to an output buffer of a Windows console]
PHP tries to enable the VT100 feature of the STDOUT/STDERR streams upon startup. If these streams are redirected to a file, VT100 features may not be enabled. If VT100 support is enabled, one can use control sequences from the VT100 terminal. They allow the modification of the terminal’s output, and – on Windows – are known as Console Virtual Terminal Sequences. This function uses the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag implemented in the Windows 10API, so the VT100 feature may not be available on older versions of Windows.
sapi_windows_vt100_support(stream, enable[optional boolean parameter, with no default value]);
[stream specifies the stream upon which the function will operate. enable specifies whether the VT100 feature will be enabled [TRUE] or not [FALSE].]
sapi_windows_vt100_support(): if enable is omitted, the function returns TRUE if stream has VT100 control codes enabled, FALSE if not. If enable has been specified, the function will try to enable or disable the VT100 features of stream — if the enabling/disabling of VT100 features has been successful then the function returns TRUE; otherwise, FALSE is returned.
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.