Changeset 1437 for trunk/system/helpers/arr.php
- Timestamp:
- 12/06/2007 08:15:37 PM (12 months ago)
- Files:
-
- 1 modified
-
trunk/system/helpers/arr.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/helpers/arr.php
r1333 r1437 24 24 * The transformed array 25 25 */ 26 function rotate($source_array, $keep_keys = TRUE)26 public function rotate($source_array, $keep_keys = TRUE) 27 27 { 28 28 $new_array = array(); … … 50 50 * The value of the requested array key 51 51 */ 52 function remove($key, & $array)52 public function remove($key, & $array) 53 53 { 54 54 if ( ! isset($array[$key])) … … 60 60 return $val; 61 61 } 62 } 62 63 /** 64 * Because PHP does not have this function. 65 * 66 * @param array array to unshift 67 * @param string key to unshift 68 * @param mixed value to unshift 69 * @return array 70 */ 71 public function unshift_assoc( array & $array, $key, $val) 72 { 73 $array = array_reverse($array, TRUE); 74 $array[$key] = $val; 75 $array = array_reverse($array, TRUE); 76 77 return $array; 78 } 79 80 } // End arr
