HOW THE QUIZ WORKS:
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:
PURPOSE:
This webpage serves two purposes:
- It provides a reference table for the PHP array functions, with information extracted and condensed from w3schools.com and php.net.
- It enables users to complete a quiz related to the PHP array functions.
USAGE:
For each array 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 array 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.
Once the randomization of function descriptions, function syntaxes, and function return values has taken place, an ‘AUTO COMPLETE‘ button will appear above a button that facilitates a ‘RETURN TO VIEWPORT SELECTION‘. Clicking the ‘AUTO COMPLETE‘ button initiates a ‘self-completing quiz’ effect: the table cells will be correctly rearranged before your eyes in real-time. This ‘self-completion in real-time’ lasts approximately one-and-a-half minutes. You can rearrange the cells in any order that you like before clicking the ‘AUTO COMPLETE‘ button – the quiz will still ‘complete itself’.
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 |
|---|---|---|---|
reset()
[Set the internal pointer of an array to its first element] |
Rewinds [‘resets’] array‘s internal pointer to the first element and returns the value found there. | reset(array); |
Returns the value of the first array element, or FALSE if the array is empty. |
rsort()
[Sort an array in reverse order] |
Sorts the values of array in descending [reverse] order. If two members compare as equal their relative order in the sorted array is undefined. Assigns new keys to the elements of array. | rsort(array, sort_flags [optional]);
[sort_flags options: SORT_REGULAR; SORT_NUMERIC; SORT_STRING; SORT_LOCALE_STRING; SORT_NATURAL; and SORT_FLAG_CASE.] |
rsort(): returns TRUE on success or FALSE on failure. |
shuffle()
[Shuffle an array] |
Shuffles an array [randomizes the array’s elemental ordering], using a pseudo random number generator unsuitable for cryptographic purposes. If two elements compare as equal their relative position in the shuffled array is undefined. New keys are assigned to the elements in array. |
shuffle(array); |
shuffle(): returns TRUE on success or FALSE on failure. |
sort()
[Sort an array] |
Sorts an array in ascending elemental order. If two elements compare as equal their relative order in the sorted array is undefined. New keys are assigned to elements in array. | sort(array, sort_flags [optional]);
[The following sort_flags are available: SORT_REGULAR; SORT_NUMERIC; SORT_STRING; SORT_LOCALE_STRING; SORT_NATURAL; and SORT_FLAG_CASE.] |
sort(): returns TRUE on success or FALSE on failure. |
uasort()
[Sort an array with a user-defined comparison function and maintain index association] |
Sorts array such that array indices maintain their correlation with the elements they are associated with, using a user-defined comparison_function. If two members compare as equal their relative order in the sorted array is undefined. | uasort(array, comparison_function);
[comparison_function must return an integer less than, equal to, or greater than 0 depending upon whether the first argument is considered to be respectively less than, equal to, or greater than the second argument.] |
uasort(): returns TRUE on success or FALSE on failure. |
uksort()
[Sort an array by keys using a user-defined comparison function] |
Sorts the keys of array, using a user-defined comparison_function. If two members compare as equal their relative order in the sorted array is undefined. | uksort(array, comparison_function);
[comparison_function must return an integer less than, equal to, or greater than 0 depending upon whether the first argument is considered to be respectively less than, equal to, or greater than the second argument.] |
uksort(): returns TRUE on success or FALSE on failure. |
usort()
[Sort an array by values using a user-defined comparison function] |
Sorts the values of array, using a user-defined comparison_function. If two members compare as equal their relative order in the sorted array is undefined. New keys are assigned to elements in array. | usort(array, comparison_function);
[comparison_function must return an integer less than, equal to, or greater than 0 depending upon whether the first argument is considered to be respectively less than, equal to, or greater than the second argument.] |
usort(): returns TRUE on success or FALSE on failure. |
