CI_URI::segment_array()

segment_array() Returns: URI segments array Return type: array Returns an array containing the URI segments. For example: $segs = $this->uri->segment_array(); foreach ($segs as $segment) { echo $segment; echo '<br />'; }

CI_URI::total_rsegments()

total_rsegments() Returns: Count of routed URI segments Return type: int This method is identical to total_segments(), except that it returns the total number of segments in your re-routed URI in the event you are using CodeIgniter’s URI Routing feature.

CI_URI::slash_segment()

slash_segment($n[, $where = 'trailing']) Parameters: $n (int) – Segment index number $where (string) – Where to add the slash (‘trailing’ or ‘leading’) Returns: Segment value, prepended/suffixed with a forward slash, or a slash if not found Return type: string This method is almost identical to segment(), except it adds a trailing and/or leading slash based on the second parameter. If the parameter is not used, a trailing slash added. Examples: $this->uri->slash_segment(3); $

safe_mailto()

safe_mailto($email, $title = '', $attributes = '') Parameters: $email (string) – E-mail address $title (string) – Anchor title $attributes (mixed) – HTML attributes Returns: A spam-safe “mail to” hyperlink Return type: string Identical to the mailto() function except it writes an obfuscated version of the mailto tag using ordinal numbers written with JavaScript to help prevent the e-mail address from being harvested by spam bots.

CI_Typography::nl2br_except_pre()

nl2br_except_pre($str) Parameters: $str (string) – Input string Returns: Formatted string Return type: string Converts newlines to <br /> tags unless they appear within <pre> tags. This method is identical to the native PHP nl2br() function, except that it ignores <pre> tags. Usage example: $string = $this->typography->nl2br_except_pre($string);

CI_Trackback::convert_ascii()

convert_ascii($str) Parameters: $str (string) – Input string Returns: Converted string Return type: string Converts high ASCII text and MS Word special characterss to HTML entities.

CI_Typography::format_characters()

format_characters($str) Parameters: $str (string) – Input string Returns: Formatted string Return type: string This method is similar to auto_typography() above, except that it only does character conversion: Quotes are converted to correctly facing curly quote entities, except those that appear within tags. Apostrophes are converted to curly apostrophe entities. Double dashes (either like – this or like–this) are converted to em—dashes. Three consecutive periods either preceding or

highlight_phrase()

highlight_phrase($str, $phrase[, $tag_open = ''[, $tag_close = '']]) Parameters: $str (string) – Input string $phrase (string) – Phrase to highlight $tag_open (string) – Opening tag used for the highlight $tag_close (string) – Closing tag for the highlight Returns: String with a phrase highlighted via HTML Return type: string Will highlight a phrase within a text string. The first parameter will contain the original string, the second will contain the phrase you wish to highlight

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_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.