symbolic_permissions()

symbolic_permissions($perms) Parameters: $perms (int) – Permissions Returns: Symbolic permissions string Return type: string Takes numeric permissions (such as is returned by fileperms()) and returns standard symbolic notation of file permissions. echo symbolic_permissions(fileperms('./index.php')); // -rw-r--r--

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

singular()

singular($str) Parameters: $str (string) – Input string Returns: A singular word Return type: string Changes a plural word to singular. Example: echo singular('dogs'); // Prints 'dog'

site_url()

site_url([$uri = ''[, $protocol = NULL]]) Parameters: $uri (string) – URI string $protocol (string) – Protocol, e.g. ‘http’ or ‘https’ Returns: Site URL Return type: string Returns your site URL, as specified in your config file. The index.php file (or whatever you have set as your site index_page in your config file) will be added to the URL, as will any URI segments you pass to the function, plus the url_suffix as set in your config file. You are encouraged to use this function a

standard_date()

standard_date([$fmt = 'DATE_RFC822'[, $time = NULL]]) Parameters: $fmt (string) – Date format $time (int) – UNIX timestamp Returns: Formatted date or FALSE on invalid format Return type: string Lets you generate a date string in one of several standardized formats. Example: $format = 'DATE_RFC822'; $time = time(); echo standard_date($format, $time); Note This function is DEPRECATED. Use the native date() combined with DateTime’s format constants instead: echo date(DATE_RFC822, ti

show_error()

show_error($message, $status_code, $heading = 'An Error Was Encountered') Parameters: $message (mixed) – Error message $status_code (int) – HTTP Response status code $heading (string) – Error page heading Return type: void This function will display the error message supplied to it using the error template appropriate to your execution: application/views/errors/html/error_general.php or: application/views/errors/cli/error_general.php The optional parameter $status_code determine

show_404()

show_404($page = '', $log_error = TRUE) Parameters: $page (string) – URI string $log_error (bool) – Whether to log the error Return type: void This function will display the 404 error message supplied to it using the error template appropriate to your execution: application/views/errors/html/error_404.php or: application/views/errors/cli/error_404.php The function expects the string passed to it to be the file path to the page that isn’t found. The exit status code will be set to

set_status_header()

set_status_header($code[, $text = '']) Parameters: $code (int) – HTTP Reponse status code $text (string) – A custom message to set with the status code Return type: void Permits you to manually set a server status header. Example: set_status_header(401); // Sets the header as: Unauthorized See here for a full list of headers.

set_realpath()

set_realpath($path[, $check_existance = FALSE]) Parameters: $path (string) – Path $check_existance (bool) – Whether to check if the path actually exists Returns: An absolute path Return type: string This function will return a server path without symbolic links or relative directory structures. An optional second argument will cause an error to be triggered if the path cannot be resolved. Examples: $file = '/etc/php5/apache2/php.ini'; echo set_realpath($file); // Prints '/etc/php5/

set_value()

set_value($field[, $default = ''[, $html_escape = TRUE]]) Parameters: $field (string) – Field name $default (string) – Default value $html_escape (bool) – Whether to turn off HTML escaping of the value Returns: Field value Return type: string Permits you to set the value of an input form or textarea. You must supply the field name via the first parameter of the function. The second (optional) parameter allows you to set a default value for the form. The third (optional) parameter