summaryrefslogtreecommitdiffstats
path: root/system/helpers/array_helper.php
diff options
context:
space:
mode:
authorTimothy Warren <tim@timshomepage.net>2012-04-27 17:36:50 +0200
committerTimothy Warren <tim@timshomepage.net>2012-04-27 17:36:50 +0200
commit01b129a42b62fd08cd873f44ded026041b560420 (patch)
treed34d5e987196bccd19684388e4f161c8a66269b5 /system/helpers/array_helper.php
parent2fbd57d6d58afd64caa841a876e9773272275526 (diff)
Fix docblocks A-H
Diffstat (limited to 'system/helpers/array_helper.php')
-rw-r--r--system/helpers/array_helper.php56
1 files changed, 28 insertions, 28 deletions
diff --git a/system/helpers/array_helper.php b/system/helpers/array_helper.php
index 6f56d9db9..6a7c8e3c7 100644
--- a/system/helpers/array_helper.php
+++ b/system/helpers/array_helper.php
@@ -37,19 +37,19 @@
// ------------------------------------------------------------------------
-/**
- * Element
- *
- * Lets you determine whether an array index is set and whether it has a value.
- * If the element is empty it returns FALSE (or whatever you specify as the default value.)
- *
- * @param string
- * @param array
- * @param mixed
- * @return mixed depends on what the array contains
- */
if ( ! function_exists('element'))
{
+ /**
+ * Element
+ *
+ * Lets you determine whether an array index is set and whether it has a value.
+ * If the element is empty it returns FALSE (or whatever you specify as the default value.)
+ *
+ * @param string
+ * @param array
+ * @param mixed
+ * @return mixed depends on what the array contains
+ */
function element($item, $array, $default = FALSE)
{
return empty($array[$item]) ? $default : $array[$item];
@@ -58,14 +58,14 @@ if ( ! function_exists('element'))
// ------------------------------------------------------------------------
-/**
- * Random Element - Takes an array as input and returns a random element
- *
- * @param array
- * @return mixed depends on what the array contains
- */
if ( ! function_exists('random_element'))
{
+ /**
+ * Random Element - Takes an array as input and returns a random element
+ *
+ * @param array
+ * @return mixed depends on what the array contains
+ */
function random_element($array)
{
return is_array($array) ? $array[array_rand($array)] : $array;
@@ -74,19 +74,19 @@ if ( ! function_exists('random_element'))
// --------------------------------------------------------------------
-/**
- * Elements
- *
- * Returns only the array items specified. Will return a default value if
- * it is not set.
- *
- * @param array
- * @param array
- * @param mixed
- * @return mixed depends on what the array contains
- */
if ( ! function_exists('elements'))
{
+ /**
+ * Elements
+ *
+ * Returns only the array items specified. Will return a default value if
+ * it is not set.
+ *
+ * @param array
+ * @param array
+ * @param mixed
+ * @return mixed depends on what the array contains
+ */
function elements($items, $array, $default = FALSE)
{
$return = array();