1 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
5 * An open source application development framework for PHP 4.3.2 or newer
8 * @author ExpressionEngine Dev Team
9 * @copyright Copyright (c) 2008 - 2009, EllisLab, Inc.
10 * @license http://codeigniter.com/user_guide/license.html
11 * @link http://codeigniter.com
16 // ------------------------------------------------------------------------
19 * CodeIgniter Array Helpers
21 * @package CodeIgniter
24 * @author ExpressionEngine Dev Team
25 * @link http://codeigniter.com/user_guide/helpers/array_helper.html
28 // ------------------------------------------------------------------------
33 * Lets you determine whether an array index is set and whether it has a value.
34 * If the element is empty it returns FALSE (or whatever you specify as the default value.)
40 * @return mixed depends on what the array contains
42 if ( ! function_exists('element'))
44 function element($item, $array, $default = FALSE)
46 if ( ! isset($array[$item]) OR $array[$item] == "")
55 // ------------------------------------------------------------------------
58 * Random Element - Takes an array as input and returns a random element
62 * @return mixed depends on what the array contains
64 if ( ! function_exists('random_element'))
66 function random_element($array)
68 if ( ! is_array($array))
72 return $array[array_rand($array)];
77 /* End of file array_helper.php */
78 /* Location: ./system/helpers/array_helper.php */