String handling functions. More...
Functions | |
string_replace ($string, $array) | |
Find and replace multiple characters or strings in a string - takes source string and array of find=>replace values. | |
string_contains ($haystack, $needle) | |
Check to see if one string contains another. | |
string_clean ($text, $ignore_chars='', $options=array()) | |
Converts a string to a format suitable for files and urls. | |
string_date ($date_string=null, $format=null) | |
Converts a strtotime string in UK format (eg 7/3/09 is 7th of March) to a date of the required format. | |
string_date_db ($date_string_uk_or_timestamp=null, $format=null) | |
Formats the date in an ISO format. | |
string_date_is_empty ($date) | |
Checks to see if date is empty or a null value. | |
string_truncate ($text, $num_chars, $options=array()) | |
Truncates text by given number of characters. | |
string_xml_entities ($str) | |
Replaces all html entities ('&') to its xml counterpart('&');. | |
string_format_postcode ($string) | |
Formats a string as a UK postcode - upper case letters and spaces in the right places. | |
string_title_case ($string) | |
Forces the string format to title case. | |
string_append (&$string, $to_append, $prefix=', ', $suffix='') | |
Append a string to another. | |
string_labelize ($string) | |
Create a label from a database field name. | |
string_format_address ($array, $filter=null) | |
Formats an address array as an address string, separated by commas. | |
string_replace_smart_quotes ($text) | |
Replace smart quotes and special characters with straight quotes, dashes etc. | |
string_password ($length=8, $is_numbers=true, $is_letters_lc=true, $is_letters_uc=false) | |
Generate random password. |
String handling functions.
string_truncate | ( | $text, | |
$num_chars, | |||
$options = array() |
|||
) |
Truncates text by given number of characters.
Optionally appends an elipsis ('...')