strip_quotes()

strip_quotes($str) Parameters: $str (string) – Input string Returns: String with quotes stripped Return type: string Removes single and double quotes from a string. Example: $string = "Joe's \"dinner\""; $string = strip_quotes($string); //results in "Joes dinner"

CI_User_agent::is_mobile()

is_mobile([$key = NULL]) Parameters: $key (string) – Optional mobile device name Returns: TRUE if the user agent is a (specified) mobile device, FALSE if not Return type: bool Returns TRUE/FALSE (boolean) if the user agent is a known mobile device. if ($this->agent->is_mobile('iphone')) { $this->load->view('iphone/home'); } elseif ($this->agent->is_mobile()) { $this->load->view('mobile/home'); } else { $this->load->view('web/home

CI_FTP::delete_dir()

delete_dir($filepath) Parameters: $filepath (string) – Path to directory to delete Returns: TRUE on success, FALSE on failure Return type: bool Lets you delete a directory and everything it contains. Supply the source path to the directory with a trailing slash. Important Be VERY careful with this method! It will recursively delete everything within the supplied path, including sub-folders and all files. Make absolutely sure your path is correct. Try using list_files() first to ver

CI_Cart::contents()

contents([$newest_first = FALSE]) Parameters: $newest_first (bool) – Whether to order the array with newest items first Returns: An array of cart contents Return type: array Returns an array containing everything in the cart. You can sort the order by which the array is returned by passing it TRUE where the contents will be sorted from newest to oldest, otherwise it is sorted from oldest to newest.

CI_DB_result::result_array()

result_array() Returns: Array containing the fetched rows Return type: array Returns the query results as an array of rows, where each row is itself an associative array. Usage: see Result Arrays.

CI_DB_query_builder::get_where()

get_where([$table = ''[, $where = NULL[, $limit = NULL[, $offset = NULL]]]]) Parameters: $table (mixed) – The table(s) to fetch data from; string or array $where (string) – The WHERE clause $limit (int) – The LIMIT clause $offset (int) – The OFFSET clause Returns: CI_DB_result instance (method chaining) Return type: CI_DB_result Same as get(), but also allows the WHERE to be added directly.

CI_Unit_test::use_strict()

use_strict([$state = TRUE]) Parameters: $state (bool) – Strict state flag Return type: void Enables/disables strict type comparison in tests.

Handling Multiple Environments

Developers often desire different system behavior depending on whether an application is running in a development or production environment. For example, verbose error output is something that would be useful while developing an application, but it may also pose a security issue when “live”. The ENVIRONMENT Constant By default, CodeIgniter comes with the environment constant set to use the value provided in $_SERVER['CI_ENV'], otherwise defaults to ‘development’. At the top of index.php, you wi

CI_Parser::parse()

parse($template, $data[, $return = FALSE]) Parameters: $template (string) – Path to view file $data (array) – Variable data $return (bool) – Whether to only return the parsed template Returns: Parsed template string Return type: string Parses a template from the provided path and variables.

CI_DB_query_builder::set_update_batch()

set_update_batch($key[, $value = ''[, $escape = NULL]]) Parameters: $key (mixed) – Field name or an array of field/value pairs $value (string) – Field value, if $key is a single field $escape (bool) – Whether to escape values and identifiers Returns: CI_DB_query_builder instance (method chaining) Return type: CI_DB_query_builder Adds field/value pairs to be updated in a table later via update_batch().