nl2br_except_pre()

nl2br_except_pre($str) Parameters: $str (string) – Input string Returns: String with HTML-formatted line breaks Return type: string Converts newlines to <br /> tags unless they appear within <pre> tags. This function is identical to the native PHP nl2br() function, except that it ignores <pre> tags. Usage example: $string = nl2br_except_pre($string);

CI_DB_driver

class CI_DB_driver initialize() Returns: TRUE on success, FALSE on failure Return type: bool Initialize database settings, establish a connection to the database. db_connect($persistent = TRUE) Parameters: $persistent (bool) – Whether to establish a persistent connection or a regular one Returns: Database connection resource/object or FALSE on failure Return type: mixed Establish a connection with the database. Note The returned value depends on the underlying driver in use.

CI_DB_driver::initialize()

initialize() Returns: TRUE on success, FALSE on failure Return type: bool Initialize database settings, establish a connection to the database.

CI_Session::get_flash_keys()

get_flash_keys() Returns: Array containing the keys of all “flashdata” items. Return type: array Gets a list of all $_SESSION that have been marked as “flashdata”.

CI_Benchmark::mark()

mark($name) Parameters: $name (string) – the name you wish to assign to your marker Return type: void Sets a benchmark marker.

CI_URI::ruri_string()

ruri_string() Returns: Routed URI string Return type: string This method is identical to uri_string(), except that it returns the re-routed URI in the event you are using CodeIgniter’s URI Routing feature.

CI_Email::attach()

attach($filename[, $disposition = ''[, $newname = NULL[, $mime = '']]]) Parameters: $filename (string) – File name $disposition (string) – ‘disposition’ of the attachment. Most email clients make their own decision regardless of the MIME specification used here. https://www.iana.org/assignments/cont-disp/cont-disp.xhtml $newname (string) – Custom file name to use in the e-mail $mime (string) – MIME type to use (useful for buffered data) Returns: CI_Email instance (method chaining) R

read_file()

read_file($file) Parameters: $file (string) – File path Returns: File contents or FALSE on failure Return type: string Returns the data contained in the file specified in the path. Example: $string = read_file('./path/to/file.php'); The path can be a relative or full server path. Returns FALSE (boolean) on failure. Note The path is relative to your main site index.php file, NOT your controller or view files. CodeIgniter uses a front controller so paths are always relative to the m

Transactions

CodeIgniter’s database abstraction allows you to use transactions with databases that support transaction-safe table types. In MySQL, you’ll need to be running InnoDB or BDB table types rather than the more common MyISAM. Most other database platforms support transactions natively. If you are not familiar with transactions we recommend you find a good online resource to learn about them for your particular database. The information below assumes you have a basic understanding of transactions. C

CodeIgniter URLs

By default, URLs in CodeIgniter are designed to be search-engine and human friendly. Rather than using the standard “query string” approach to URLs that is synonymous with dynamic systems, CodeIgniter uses a segment-based approach: example.com/news/article/my_article Note Query string URLs can be optionally enabled, as described below. URI Segments The segments in the URL, in following with the Model-View-Controller approach, usually represent: example.com/class/function/ID The first segmen