\

Namespaces

Anax
Rasb14

Functions

array_merge_recursive_distinct()

array_merge_recursive_distinct(array  $array1, array  $array2) : array

array_merge_recursive does indeed merge arrays, but it converts values with duplicate keys to arrays rather than overwriting the value in the first array with the duplicate value in the second array, as array_merge does. I.e., with array_merge_recursive, this happens (documented behavior):

array_merge_recursive(['key' => 'org value'], ['key' => 'new value']); => ['key' => ['org value', 'new value']];

array_merge_recursive_distinct does not change the datatypes of the values in the arrays. Matching keys' values in the second array overwrite those in the first array, as is the case with array_merge, i.e.:

array_merge_recursive_distinct(['key' => 'org value'], ['key' => 'new value']); => ['key' => ['new value']];

Parameters are passed by reference, though only for performance reasons. They're not altered by this function.

Parameters

array $array1
array $array2

Returns

array

t()

t(string  $str, array  $args = array()) : string

i18n, internationalization, send all strings though this function to enable i18n. Inspired by Drupal“s t()-function.

Parameters

string $str

the string to check up for translation.

array $args

associative array with arguments to be replaced in the str.

  • !variable: Inserted as is. Use this for text that has already been sanitized.
  • @variable: Escaped to HTML using htmlEnt(). Use this for anything displayed on a page on the site.

Returns

string —

the translated string.