octal_permissions()

octal_permissions($perms) Parameters: $perms (int) – Permissions Returns: Octal permissions string Return type: string Takes numeric permissions (such as is returned by fileperms()) and returns a three character octal notation of file permissions. echo octal_permissions(fileperms('./index.php')); // 644

ol()

ol($list, $attributes = '') Parameters: $list (array) – List entries $attributes (array) – HTML attributes Returns: HTML-formatted ordered list Return type: string Identical to ul(), only it produces the <ol> tag for ordered lists instead of <ul>.

password_get_info()

password_get_info($hash) Parameters: $hash (string) – Password hash Returns: Information about the hashed password Return type: array For more information, please refer to the PHP manual for password_get_info().

password_hash()

password_hash($password, $algo[, $options = array()]) Parameters: $password (string) – Plain-text password $algo (int) – Hashing algorithm $options (array) – Hashing options Returns: Hashed password or FALSE on failure Return type: string For more information, please refer to the PHP manual for password_hash(). Note Unless you provide your own (and valid) salt, this function has a further dependency on an available CSPRNG source. Each of the following would satisfy that: - mcrypt

News section

In the last section, we went over some basic concepts of the framework by writing a class that includes static pages. We cleaned up the URI by adding custom routing rules. Now it’s time to introduce dynamic content and start using a database. Setting up your model Instead of writing database operations right in the controller, queries should be placed in a model, so they can easily be reused later. Models are the place where you retrieve, insert, and update information in your database or other

now()

now([$timezone = NULL]) Parameters: $timezone (string) – Timezone Returns: UNIX timestamp Return type: int Returns the current time as a UNIX timestamp, referenced either to your server’s local time or any PHP suported timezone, based on the “time reference” setting in your config file. If you do not intend to set your master time reference to any other PHP supported timezone (which you’ll typically do if you run a site that lets each user set their own timezone settings) there is n

nice_date()

nice_date([$bad_date = ''[, $format = FALSE]]) Parameters: $bad_date (int) – The terribly formatted date-like string $format (string) – Date format to return (same as PHP’s date() function) Returns: Formatted date Return type: string This function can take a number poorly-formed date formats and convert them into something useful. It also accepts well-formed dates. The function will return a UNIX timestamp by default. You can, optionally, pass a format string (the same type as the

nbs()

nbs([$num = 1]) Parameters: $num (int) – Number of space entities to produce Returns: A sequence of non-breaking space HTML entities Return type: string Generates non-breaking spaces (&nbsp;) based on the number you submit. Example: echo nbs(3); The above would produce: &nbsp;&nbsp;&nbsp; Note This function is DEPRECATED. Use the native str_repeat() in combination with &nbsp; instead.

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);

Models

Models are optionally available for those who want to use a more traditional MVC approach. Page Contents ModelsWhat is a Model? Anatomy of a Model Loading a Model Auto-loading Models Connecting to your Database What is a Model? Models are PHP classes that are designed to work with information in your database. For example, let’s say you use CodeIgniter to manage a blog. You might have a model class that contains functions to insert, update, and retrieve your blog data. Here is an example of