diff options
Diffstat (limited to 'user_guide')
-rw-r--r-- | user_guide/helpers/array_helper.html | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html index d719be9c7..4ab83da69 100644 --- a/user_guide/helpers/array_helper.html +++ b/user_guide/helpers/array_helper.html @@ -73,6 +73,21 @@ Array Helper <p>The following functions are available:</p>
+<h2>element()</h2>
+
+<p>Lets you fetch an item from an array. The function tests whether the array index is set and whether it has a value. If
+a value exists it is returned. If a value does not exist it returns FALSE, or whater you've specified as the default value via the third parameter. Example:</p>
+
+<code>
+$array = array('color' => 'red', 'shape' => 'round', 'size' => '');<br />
+<br />
+// returns "red"<br />
+echo element('color', $array);<br />
+<br />
+// returns NULL<br />
+echo element('size', $array, NULL);
+</code>
+
<h2>random_element()</h2>
|