byte_format()

byte_format($num[, $precision = 1]) Parameters: $num (mixed) – Number of bytes $precision (int) – Floating point precision Returns: Formatted data size string Return type: string Formats numbers as bytes, based on size, and adds the appropriate suffix. Examples: echo byte_format(456); // Returns 456 Bytes echo byte_format(4567); // Returns 4.5 KB echo byte_format(45678); // Returns 44.6 KB echo byte_format(456789); // Returns 447.8 KB echo byte_format(3456789); // Returns 3.3 MB ec

br()

br([$count = 1]) Parameters: $count (int) – Number of times to repeat the tag Returns: HTML line break tag Return type: string Generates line break tags (<br />) based on the number you submit. Example: echo br(3); The above would produce: <br /><br /><br /> Note This function is DEPRECATED. Use the native str_repeat() in combination with <br /> instead.

base_url()

base_url($uri = '', $protocol = NULL) Parameters: $uri (string) – URI string $protocol (string) – Protocol, e.g. ‘http’ or ‘https’ Returns: Base URL Return type: string Returns your site base URL, as specified in your config file. Example: echo base_url(); This function returns the same thing as site_url(), without the index_page or url_suffix being appended. Also like site_url(), you can supply segments as a string or an array. Here is a string example: echo base_url("blog/post/1

auto_typography()

auto_typography($str[, $reduce_linebreaks = FALSE]) Parameters: $str (string) – Input string $reduce_linebreaks (bool) – Whether to reduce multiple instances of double newlines to two Returns: HTML-formatted typography-safe string Return type: string Formats text so that it is semantically and typographically correct HTML. This function is an alias for CI_Typography::auto_typography(). For more info, please see the Typography Library documentation. Usage example: $string = auto_typ

auto_link()

auto_link($str, $type = 'both', $popup = FALSE) Parameters: $str (string) – Input string $type (string) – Link type (‘email’, ‘url’ or ‘both’) $popup (bool) – Whether to create popup links Returns: Linkified string Return type: string Automatically turns URLs and e-mail addresses contained in a string into links. Example: $string = auto_link($string); The second parameter determines whether URLs and e-mails are converted or just one or the other. Default behavior is both if the p

Auto-loading Resources

CodeIgniter comes with an “Auto-load” feature that permits libraries, helpers, and models to be initialized automatically every time the system runs. If you need certain resources globally throughout your application you should consider auto-loading them for convenience. The following items can be loaded automatically: Classes found in the libraries/ directory Helper files found in the helpers/ directory Custom config files found in the config/ directory Language files found in the system/langu

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

array_replace_recursive()

array_replace_recursive(array $array1[, ...]) Parameters: $array1 (array) – Array in which to replace elements ... (array) – Array (or multiple ones) from which to extract elements Returns: Modified array Return type: array For more information, please refer to the PHP manual for array_replace_recursive(). Important Only PHP’s native function can detect endless recursion. Unless you are running PHP 5.3+, be careful with references!

array_replace()

array_replace(array $array1[, ...]) Parameters: $array1 (array) – Array in which to replace elements ... (array) – Array (or multiple ones) from which to extract elements Returns: Modified array Return type: array For more information, please refer to the PHP manual for array_replace().

array_column()

array_column(array $array, $column_key[, $index_key = NULL]) Parameters: $array (array) – Array to fetch results from $column_key (mixed) – Key of the column to return values from $index_key (mixed) – Key to use for the returned values Returns: An array of values representing a single column from the input array Return type: array For more information, please refer to the PHP manual for array_column().