diff --git a/reference/array/functions/array-first.xml b/reference/array/functions/array-first.xml new file mode 100644 index 000000000000..f661cb6d1826 --- /dev/null +++ b/reference/array/functions/array-first.xml @@ -0,0 +1,95 @@ + + + + array_first + Gets the first value of an array + + + + &reftitle.description; + + mixedarray_first + arrayarray + + + Get the first value of the given array. + + + + + &reftitle.parameters; + + + array + + + An array. + + + + + + + + &reftitle.returnvalues; + + Returns the first value of array if the array is not empty; + &null; otherwise. + + + + + &reftitle.examples; + + + Basic <function>array_first</function> Usage + + 'a', 0 => 'b', 3 => 'c', 2 => 'd']; + +$firstValue = array_first($array); + +var_dump($firstValue); +?> +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + array_key_first + array_last + + + + + diff --git a/reference/array/functions/array-key-first.xml b/reference/array/functions/array-key-first.xml index 85f8ea428805..64cac0f8773b 100644 --- a/reference/array/functions/array-key-first.xml +++ b/reference/array/functions/array-key-first.xml @@ -98,6 +98,7 @@ if (!function_exists('array_key_first')) { &reftitle.seealso; + array_first array_key_last reset diff --git a/reference/array/functions/array-key-last.xml b/reference/array/functions/array-key-last.xml index 8137e78fe141..276203f2217c 100644 --- a/reference/array/functions/array-key-last.xml +++ b/reference/array/functions/array-key-last.xml @@ -43,6 +43,7 @@ &reftitle.seealso; + array_last array_key_first end diff --git a/reference/array/functions/array-last.xml b/reference/array/functions/array-last.xml new file mode 100644 index 000000000000..5684416750e5 --- /dev/null +++ b/reference/array/functions/array-last.xml @@ -0,0 +1,95 @@ + + + + array_last + Gets the last value of an array + + + + &reftitle.description; + + mixedarray_last + arrayarray + + + Get the last value of the given array. + + + + + &reftitle.parameters; + + + array + + + An array. + + + + + + + + &reftitle.returnvalues; + + Returns the last value of array if the array is not empty; + &null; otherwise. + + + + + &reftitle.examples; + + + Basic <function>array_last</function> Usage + + 'a', 0 => 'b', 3 => 'c', 2 => 'd']; + +$lastValue = array_last($array); + +var_dump($lastValue); +?> +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + array_key_last + array_first + + + + + diff --git a/reference/array/versions.xml b/reference/array/versions.xml index 39a5e36c7732..8017e8852e16 100644 --- a/reference/array/versions.xml +++ b/reference/array/versions.xml @@ -22,6 +22,7 @@ + @@ -33,6 +34,7 @@ +