is_php()

is_php($version) Parameters: $version (string) – Version number Returns: TRUE if the running PHP version is at least the one specified or FALSE if not Return type: bool Determines if the PHP version being used is greater than the supplied version number. Example: if (is_php('5.3')) { $str = quoted_printable_encode($str); } Returns boolean TRUE if the installed version of PHP is equal to or greater than the supplied version number. Returns FALSE if the installed version of P

function_usable()

function_usable($function_name) Parameters: $function_name (string) – Function name Returns: TRUE if the function can be used, FALSE if not Return type: bool Returns TRUE if a function exists and is usable, FALSE otherwise. This function runs a function_exists() check and if the Suhosin extension <http://www.hardened-php.net/suhosin/> is loaded, checks if it doesn’t disable the function being checked. It is useful if you want to check for the availability of functions such as

CI_Calendar::adjust_date()

adjust_date($month, $year) Parameters: $month (int) – Month $year (int) – Year Returns: An associative array containing month and year Return type: array This method makes sure that you have a valid month/year. For example, if you submit 13 as the month, the year will increment and the month will become January: print_r($this->calendar->adjust_date(13, 2014)); outputs: Array ( [month] => '01' [year] => '2015' )

repeater()

repeater($data[, $num = 1]) Parameters: $data (string) – Input $num (int) – Number of times to repeat Returns: Repeated string Return type: string Generates repeating copies of the data you submit. Example: $string = "\n"; echo repeater($string, 30); The above would generate 30 newlines. Note This function is DEPRECATED. Use the native str_repeat() instead.

CI_DB_driver::db_select()

db_select([$database = '']) Parameters: $database (string) – Database name Returns: TRUE on success, FALSE on failure Return type: bool Select / switch the current database.

sanitize_filename()

sanitize_filename($filename) Parameters: $filename (string) – Filename Returns: Sanitized file name Return type: string Provides protection against directory traversal. This function is an alias for CI_Security::sanitize_filename(). For more info, please see the Security Library documentation.

CI_Cache::get_metadata()

get_metadata($id) Parameters: $id (string) – Cache item name Returns: Metadata for the cached item Return type: mixed This method will return detailed information on a specific item in the cache. var_dump($this->cache->get_metadata('my_cached_item')); Note The information returned and the structure of the data is dependent on which adapter is being used.

form_open()

form_open([$action = ''[, $attributes = ''[, $hidden = array()]]]) Parameters: $action (string) – Form action/target URI string $attributes (array) – HTML attributes $hidden (array) – An array of hidden fields’ definitions Returns: An HTML form opening tag Return type: string Creates an opening form tag with a base URL built from your config preferences. It will optionally let you add form attributes and hidden input fields, and will always add the accept-charset attribute based o

CI_Cache::get()

get($id) Parameters: $id (string) – Cache item name Returns: Item value or FALSE if not found Return type: mixed This method will attempt to fetch an item from the cache store. If the item does not exist, the method will return FALSE. $foo = $this->cache->get('my_cached_item');

directory_map()

directory_map($source_dir[, $directory_depth = 0[, $hidden = FALSE]]) Parameters: $source_dir (string) – Path to the source directory $directory_depth (int) – Depth of directories to traverse (0 = fully recursive, 1 = current dir, etc) $hidden (bool) – Whether to include hidden directories Returns: An array of files Return type: array Examples: $map = directory_map('./mydirectory/'); Note Paths are almost always relative to your main index.php file. Sub-folders contained within