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().

Query Helper Methods

Information From Executing a Query $this->db->insert_id() The insert ID number when performing database inserts. Note If using the PDO driver with PostgreSQL, or using the Interbase driver, this function requires a $name parameter, which specifies the appropriate sequence to check for the insert id. $this->db->affected_rows() Displays the number of affected rows, when doing “write” type queries (insert, update, etc.). Note In MySQL “DELETE FROM TABLE” returns 0 affected rows. The

Queries

Query Basics Regular Queries To submit a query, use the query function: $this->db->query('YOUR QUERY HERE'); The query() function returns a database result object when “read” type queries are run, which you can use to show your results. When “write” type queries are run it simply returns TRUE or FALSE depending on success or failure. When retrieving data you will typically assign the query to your own variable, like this: $query = $this->db->query('YOUR QUERY HERE'); Simplified Qu

Profiling Your Application

The Profiler Class will display benchmark results, queries you have run, and $_POST data at the bottom of your pages. This information can be useful during development in order to help with debugging and optimization. Initializing the Class Important This class does NOT need to be initialized. It is loaded automatically by the Output Library if profiling is enabled as shown below. Enabling the Profiler To enable the profiler place the following line anywhere within your Controller methods: $t

prep_url()

prep_url($str = '') Parameters: $str (string) – URL string Returns: Protocol-prefixed URL string Return type: string This function will add http:// in the event that a protocol prefix is missing from a URL. Pass the URL string to the function like this: $url = prep_url('example.com');

plural()

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

PHP Style Guide

The following page describes the coding styles adhered to when contributing to the development of CodeIgniter. There is no requirement to use these styles in your own CodeIgniter application, though they are recommended. Table of Contents PHP Style Guide File FormatTextMate BBEdit PHP Closing Tag File Naming Class and Method Naming Variable Names Commenting Constants TRUE, FALSE, and NULL Logical Operators Comparing Return Values and Typecasting Debugging Code Whitespace in Files Compatibilit

password_verify()

password_verify($password, $hash) Parameters: $password (string) – Plain-text password $hash (string) – Password hash Returns: TRUE if the password matches the hash, FALSE if not Return type: bool For more information, please refer to the PHP manual for password_verify().

password_needs_rehash()

password_needs_rehash() Parameters: $hash (string) – Password hash $algo (int) – Hashing algorithm $options (array) – Hashing options Returns: TRUE if the hash should be rehashed to match the given algorithm and options, FALSE otherwise Return type: bool For more information, please refer to the PHP manual for password_needs_rehash().

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