| <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); |
| * An open source application development framework for PHP 4.3.2 or newer |
| * @copyright Copyright (c) 2006, pMachine, Inc. |
| * @license http://www.codeignitor.com/user_guide/license.html |
| * @link http://www.codeigniter.com |
| // ------------------------------------------------------------------------ |
| * Code Igniter Array Helpers |
| * @link http://www.codeigniter.com/user_guide/helpers/array_helper.html |
| // ------------------------------------------------------------------------ |
| * Lets you determine whether an array index is set and whether it has a value. |
| * If the element is empty it returns FALSE (or whater you specify as the default value.) |
| * @return mixed depends on what the array contains |
| function element($item, $array, $default = FALSE) |
| if ( ! isset($array[$item]) OR $array[$item] == "") |
| // ------------------------------------------------------------------------ |
| * Random Element - Takes an array as input and returns a random element |
| * @return mixed depends on what the array contains |
| function random_element($array) |
| return $array[array_rand($array)]; |