|
Moodle
2.2.1
http://www.collinsharper.com
|
Static Public Member Functions | |
| static | arrays_have_same_keys_and_values (array $array1, array $array2) |
| static | arrays_same_at_key (array $array1, array $array2, $key) |
| static | arrays_same_at_key_missing_is_blank (array $array1, array $array2, $key) |
| static | arrays_same_at_key_integer (array $array1, array $array2, $key) |
| static | int_to_roman ($number) |
Useful functions for writing question types and behaviours.
| static arrays_have_same_keys_and_values | ( | array $ | array1, |
| array $ | array2 | ||
| ) | [static] |
Tests to see whether two arrays have the same keys, with the same values (as compared by ===) for each key. However, the order of the arrays does not have to be the same.
| array | $array1 | the first array. |
| array | $array2 | the second array. |
Definition at line 685 of file lib.php.

| static arrays_same_at_key | ( | array $ | array1, |
| array $ | array2, | ||
| $ | key | ||
| ) | [static] |
Tests to see whether two arrays have the same value at a particular key. This method will return true if: 1. Neither array contains the key; or 2. Both arrays contain the key, and the corresponding values compare identical when cast to strings and compared with ===.
| array | $array1 | the first array. |
| array | $array2 | the second array. |
| string | $key | an array key. |
Definition at line 712 of file lib.php.

| static arrays_same_at_key_integer | ( | array $ | array1, |
| array $ | array2, | ||
| $ | key | ||
| ) | [static] |
Tests to see whether two arrays have the same value at a particular key. Missing values are replaced by 0, and then the values are cast to integers and compared with ===.
| array | $array1 | the first array. |
| array | $array2 | the second array. |
| string | $key | an array key. |
Definition at line 757 of file lib.php.

| static arrays_same_at_key_missing_is_blank | ( | array $ | array1, |
| array $ | array2, | ||
| $ | key | ||
| ) | [static] |
Tests to see whether two arrays have the same value at a particular key. Missing values are replaced by '', and then the values are cast to strings and compared with ===.
| array | $array1 | the first array. |
| array | $array2 | the second array. |
| string | $key | an array key. |
Definition at line 732 of file lib.php.

| static int_to_roman | ( | $ | number | ) | [static] |