xss_clean()

xss_clean($str[, $is_image = FALSE]) Parameters: $str (string) – Input data $is_image (bool) – Whether we’re dealing with an image Returns: XSS-clean string Return type: string Provides Cross Site Script Hack filtering. This function is an alias for CI_Input::xss_clean(). For more info, please see the Input Library documentation.

xml_convert()

xml_convert($str[, $protect_all = FALSE]) Parameters: $str (string) – the text string to convert $protect_all (bool) – Whether to protect all content that looks like a potential entity instead of just numbered entities, e.g. &foo; Returns: XML-converted string Return type: string Takes a string as input and converts the following reserved XML characters to entities: Ampersands: & Less than and greater than characters: < > Single and double quotes: ‘ “ Dashes: - This

write_file()

write_file($path, $data[, $mode = 'wb']) Parameters: $path (string) – File path $data (string) – Data to write to file $mode (string) – fopen() mode Returns: TRUE if the write was successful, FALSE in case of an error Return type: bool Writes data to the file specified in the path. If the file does not exist then the function will create it. Example: $data = 'Some file data'; if ( ! write_file('./path/to/file.php', $data)) { echo 'Unable to write the file'; } else {

word_wrap()

word_wrap($str[, $charlim = 76]) Parameters: $str (string) – Input string $charlim (int) – Character limit Returns: Word-wrapped string Return type: string Wraps text at the specified character count while maintaining complete words. Example: $string = "Here is a simple string of text that will help us demonstrate this function."; echo word_wrap($string, 25); // Would produce: // Here is a simple string // of text that will help us // demonstrate this // function.

word_limiter()

word_limiter($str[, $limit = 100[, $end_char = '…']]) Parameters: $str (string) – Input string $limit (int) – Limit $end_char (string) – End character (usually an ellipsis) Returns: Word-limited string Return type: string Truncates a string to the number of words specified. Example: $string = "Here is a nice text string consisting of eleven words."; $string = word_limiter($string, 4); // Returns: Here is a nice The third parameter is an optional suffix added to the string. By de

word_censor()

word_censor($str, $censored[, $replacement = '']) Parameters: $str (string) – Input string $censored (array) – List of bad words to censor $replacement (string) – What to replace bad words with Returns: Censored string Return type: string Enables you to censor words within a text string. The first parameter will contain the original string. The second will contain an array of words which you disallow. The third (optional) parameter can contain a replacement value for the words. If

Web Page Caching

CodeIgniter lets you cache your pages in order to achieve maximum performance. Although CodeIgniter is quite fast, the amount of dynamic information you display in your pages will correlate directly to the server resources, memory, and processing cycles utilized, which affect your page load speeds. By caching your pages, since they are saved in their fully rendered state, you can achieve performance that nears that of static web pages. How Does Caching Work? Caching can be enabled on a per-page

Views

A view is simply a web page, or a page fragment, like a header, footer, sidebar, etc. In fact, views can flexibly be embedded within other views (within other views, etc., etc.) if you need this type of hierarchy. Views are never called directly, they must be loaded by a controller. Remember that in an MVC framework, the Controller acts as the traffic cop, so it is responsible for fetching a particular view. If you have not read the Controllers page you should do so before continuing. Using the

valid_email()

valid_email($email) Parameters: $email (string) – E-mail address Returns: TRUE if a valid email is supplied, FALSE otherwise Return type: bool Checks if the input is a correctly formatted e-mail address. Note that is doesn’t actually prove that the address will be able recieve mail, but simply that it is a validly formed address. Example: if (valid_email('[email protected]')) { echo 'email is valid'; } else { echo 'email is not valid'; } Note All that this function

validation_errors()

validation_errors([$prefix = ''[, $suffix = '']]) Parameters: $prefix (string) – Error opening tag $suffix (string) – Error closing tag Returns: HTML-formatted form validation error message(s) Return type: string Similarly to the form_error() function, returns all validation error messages produced by the Form Validation Library, with optional opening and closing tags around each of the messages. Example: echo validation_errors('<span class="error">', '</span>'); /*