Reserved Names

In order to help out, CodeIgniter uses a series of function, method, class and variable names in its operation. Because of this, some names cannot be used by a developer. Following is a list of reserved names that cannot be used. Controller names Since your controller classes will extend the main application controller you must be careful not to name your methods identically to the ones used by that class, otherwise your local methods will override them. The following is a list of reserved name

remove_invisible_characters()

remove_invisible_characters($str[, $url_encoded = TRUE]) Parameters: $str (string) – Input string $url_encoded (bool) – Whether to remove URL-encoded characters as well Returns: Sanitized string Return type: string This function prevents inserting NULL characters between ASCII characters, like Java\0script. Example: remove_invisible_characters('Java\\0script'); // Returns: 'Javascript'

reduce_multiples()

reduce_multiples($str[, $character = ''[, $trim = FALSE]]) Parameters: $str (string) – Text to search in $character (string) – Character to reduce $trim (bool) – Whether to also trim the specified character Returns: Reduced string Return type: string Reduces multiple instances of a particular character occuring directly after each other. Example: $string = "Fred, Bill,, Joe, Jimmy"; $string = reduce_multiples($string,","); //results in "Fred, Bill, Joe, Jimmy" If the third parame

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.

quoted_printable_encode()

quoted_printable_encode($str) Parameters: $str (string) – Input string Returns: 8bit-encoded string Return type: string For more information, please refer to the PHP manual for quoted_printable_encode().

reduce_double_slashes()

reduce_double_slashes($str) Parameters: $str (string) – Input string Returns: A string with normalized slashes Return type: string Converts double slashes in a string to a single slash, except those found in URL protocol prefixes (e.g. http://). Example: $string = "http://example.com//index.php"; echo reduce_double_slashes($string); // results in "http://example.com/index.php"

random_element()

random_element($array) Parameters: $array (array) – Input array Returns: A random element from the array Return type: mixed Takes an array as input and returns a random element from it. Usage example: $quotes = array( "I find that the harder I work, the more luck I seem to have. - Thomas Jefferson", "Don't stay in bed, unless you can make money in bed. - George Burns", "We didn't lose the game; we just ran out of time. - Vince Lombardi", "If everythin

redirect()

redirect($uri = '', $method = 'auto', $code = NULL) Parameters: $uri (string) – URI string $method (string) – Redirect method (‘auto’, ‘location’ or ‘refresh’) $code (string) – HTTP Response code (usually 302 or 303) Return type: void Does a “header redirect” to the URI specified. If you specify the full site URL that link will be built, but for local links simply providing the URI segments to the controller you want to direct to will create the link. The function will build the URL

random_string()

random_string([$type = 'alnum'[, $len = 8]]) Parameters: $type (string) – Randomization type $len (int) – Output string length Returns: A random string Return type: string Generates a random string based on the type and length you specify. Useful for creating passwords or generating random hashes. The first parameter specifies the type of string, the second parameter specifies the length. The following choices are available: alpha: A string with lower and uppercase letters only.

quotes_to_entities()

quotes_to_entities($str) Parameters: $str (string) – Input string Returns: String with quotes converted to HTML entities Return type: string Converts single and double quotes in a string to the corresponding HTML entities. Example: $string = "Joe's \"dinner\""; $string = quotes_to_entities($string); //results in "Joe's "dinner""