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

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"

word_censor()

word_censor($str, $censored[, $replacement = '']) Parameters: $str (string) – Input string $censored (array) – List of bad words to censor $replacement (string) – What to replace bad words with Returns: Censored string Return type: string Enables you to censor words within a text string. The first parameter will contain the original string. The second will contain an array of words which you disallow. The third (optional) parameter can contain a replacement value for the words. If

ascii_to_entities()

ascii_to_entities($str) Parameters: $str (string) – Input string Returns: A string with ASCII values converted to entities Return type: string Converts ASCII values to character entities, including high ASCII and MS Word characters that can cause problems when used in a web page, so that they can be shown consistently regardless of browser settings or stored reliably in a database. There is some dependence on your server’s supported character sets, so it may not be 100% reliable in

smiley_js()

smiley_js([$alias = ''[, $field_id = ''[, $inline = TRUE]]]) Parameters: $alias (string) – Field alias $field_id (string) – Field ID $inline (bool) – Whether we’re inserting an inline smiley Returns: Smiley-enabling JavaScript code Return type: string Generates the JavaScript that allows the images to be clicked and inserted into a form field. If you supplied an alias instead of an id when generating your smiley links, you need to pass the alias and corresponding form id into the

CI_Parser::parse_string()

parse_string($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 This method works exactly like parse(), only it accepts the template as a string instead of loading a view file.

timezones()

timezones([$tz = '']) Parameters: $tz (string) – A numeric timezone Returns: Hour difference from UTC Return type: int Takes a timezone reference (for a list of valid timezones, see the “Timezone Reference” below) and returns the number of hours offset from UTC. Example: echo timezones('UM5'); This function is useful when used with timezone_menu().

CI_Loader

class CI_Loader library($library[, $params = NULL[, $object_name = NULL]]) Parameters: $library (mixed) – Library name as a string or an array with multiple libraries $params (array) – Optional array of parameters to pass to the loaded library’s constructor $object_name (string) – Optional object name to assign the library to Returns: CI_Loader instance (method chaining) Return type: CI_Loader This method is used to load core classes. Note We use the terms “class” and “library”

CI_Session::sess_regenerate()

sess_regenerate([$destroy = FALSE]) Parameters: $destroy (bool) – Whether to destroy session data Return type: void Regenerate session ID, optionally destroying the current session’s data. Note This method is just an alias for PHP’s native session_regenerate_id() function.

Alternate PHP Syntax for View Files

If you do not utilize CodeIgniter’s template engine, you’ll be using pure PHP in your View files. To minimize the PHP code in these files, and to make it easier to identify the code blocks it is recommended that you use PHPs alternative syntax for control structures and short tag echo statements. If you are not familiar with this syntax, it allows you to eliminate the braces from your code, and eliminate “echo” statements. Automatic Short Tag Support Note If you find that the syntax described