String Class Reference
[Core]

String manipulation wrapper class. More...

List of all members.

Public Member Functions

 code2utf ($num)
 cp1252ToEntities ($str)
 encode_mime_header ($string)
 fputcsv (&$handle, $fields=array(), $delimiter= ',', $enclosure= '"')
 getHTMLEntities ()
 hasMBString ()
 hasPCREUTF8 ()
 html2ascii ($str)
 html2utf ($str)
 init ()
 isUTF8 ($str)
 mail ($to, $subject, $message, $additional_headers= '', $additional_parameters= '')
 mime_content_type ($filename)
 regexp_grep ($pattern, $input)
 regexp_match ($pattern, $subject)
 regexp_match_all ($pattern, $subject, &$matches)
 regexp_match_get ($pattern, $subject, &$matches)
 regexp_quote ($string, $delimiter= '/')
 regexp_replace ($pattern, $replacement, $subject, $limit=-1)
 regexp_replace_callback ($pattern, $callback, $subject, $limit=-1)
 regexp_split ($pattern, $subject, $limit=-1)
 stripUnsafeHtml ($input)
 strlen ($string)
 strpos ($haystack, $needle, $offset=0)
 strrpos ($haystack, $needle)
 strtolower ($string)
 strtoupper ($string)
 substr ($string, $start, $length=null)
 substr_count ($haystack, $needle)
 utf2html ($str)
 utf8Clean ($str)


Detailed Description

String manipulation wrapper class.

Definition at line 18 of file String.inc.php.


Member Function Documentation

String.code2utf ( num  ) 

Returns the UTF-8 string corresponding to the unicode value Does not require any multibyte PHP libraries (from php.net, courtesy - romans@void.lv)

Parameters:
$num int
Returns:
string

Definition at line 416 of file String.inc.php.

String.cp1252ToEntities ( str  ) 

Convert Windows CP-1252 numeric entities in a string to named HTML entities This is a helper function for transcoding into HTML/XML

Parameters:
$input string input string
Returns:
string

Definition at line 588 of file String.inc.php.

String.encode_mime_header ( string  ) 

String.fputcsv ( &$  handle,
fields = array(),
delimiter = ',',
enclosure = '"' 
)

Wrapper around fputcsv for systems that may or may not support it (i.e. PHP < 5.1.0); see PHP documentation for fputcsv.

Definition at line 721 of file String.inc.php.

References strlen(), strpos(), and substr().

Referenced by ArticleReportPlugin.display().

String.getHTMLEntities (  ) 

Return an associative array of named->numeric HTML entities Required to support HTML functions without objects in PHP4/PHP5 From php.net: function.get-html-translation-table.php

Returns:
string

Definition at line 624 of file String.inc.php.

Referenced by html2utf().

String.hasMBString (  ) 

Check if server has the mbstring library. Currently requires PHP >= 4.3.0 (for mb_strtolower, mb_strtoupper, and mb_substr_count)

Returns:
boolean

Definition at line 56 of file String.inc.php.

Referenced by InstallForm.display(), and init().

String.hasPCREUTF8 (  ) 

Check if server supports the PCRE_UTF8 modifier.

Returns:
boolean

Definition at line 73 of file String.inc.php.

Referenced by init().

String.html2ascii ( str  ) 

Convert UTF-8 numeric entities in a string to ASCII values This is a helper function for transcoding into HTML/XML

Parameters:
$str string input string
Returns:
string

Definition at line 491 of file String.inc.php.

Referenced by Transcoder.trans().

String.html2utf ( str  ) 

Convert numeric HTML entities in a string to UTF-8 encoded characters This is a native alternative to the buggy html_entity_decode() using UTF8

Parameters:
$str string input string
Returns:
string

Definition at line 474 of file String.inc.php.

References getHTMLEntities(), and regexp_replace().

Referenced by SearchHTMLParser.doRead(), and Transcoder.trans().

String.init (  ) 

Perform initialization required for the string wrapper library.

Definition at line 22 of file String.inc.php.

References Config.getVar(), hasMBString(), hasPCREUTF8(), and strtolower().

String.isUTF8 ( str  ) 

Detect whether a string contains non-ascii multibyte sequences in the UTF-8 range Does not require any multibyte PHP libraries

Parameters:
$input string input string
Returns:
boolean

Definition at line 365 of file String.inc.php.

Referenced by Core.cleanVar().

String.mail ( to,
subject,
message,
additional_headers = '',
additional_parameters = '' 
)

See also:
http://ca.php.net/manual/en/function.mail.php

Definition at line 184 of file String.inc.php.

Referenced by Mail.send().

String.mime_content_type ( filename  ) 

String.regexp_grep ( pattern,
input 
)

See also:
http://ca.php.net/manual/en/function.regexp_grep.php

Definition at line 209 of file String.inc.php.

References utf8Clean().

String.regexp_match ( pattern,
subject 
)

String.regexp_match_all ( pattern,
subject,
&$  matches 
)

String.regexp_match_get ( pattern,
subject,
&$  matches 
)

String.regexp_quote ( string,
delimiter = '/' 
)

String.regexp_replace ( pattern,
replacement,
subject,
limit = -1 
)

String.regexp_replace_callback ( pattern,
callback,
subject,
limit = -1 
)

String.regexp_split ( pattern,
subject,
limit = -1 
)

String.stripUnsafeHtml ( input  ) 

Strip unsafe HTML from the input text. Covers XSS attacks like scripts, onclick(...) attributes, javascript: urls, and special characters.

Parameters:
$input string input string
Returns:
string

Definition at line 303 of file String.inc.php.

References Config.getVar().

String.strlen ( string  ) 

String.strpos ( haystack,
needle,
offset = 0 
)

See also:
http://ca.php.net/manual/en/function.strpos.php

Definition at line 102 of file String.inc.php.

Referenced by fputcsv(), and mime_content_type().

String.strrpos ( haystack,
needle 
)

String.strtolower ( string  ) 

String.strtoupper ( string  ) 

String.substr ( string,
start,
length = null 
)

String.substr_count ( haystack,
needle 
)

String.utf2html ( str  ) 

Convert UTF-8 encoded characters in a string to escaped HTML entities This is a helper function for transcoding into HTML

Parameters:
$input string input string
Returns:
string

Definition at line 430 of file String.inc.php.

References strlen(), and substr().

Referenced by ArticleXMLGalley.getHTMLContents(), and Transcoder.trans().

String.utf8Clean ( str  ) 

Strips out any bad bytes from a UTF-8 string and returns the rest Does not require any multibyte PHP libraries

Parameters:
$input string input string
Returns:
string

Definition at line 384 of file String.inc.php.

References strlen(), and substr().

Referenced by regexp_grep(), regexp_match(), regexp_match_all(), regexp_match_get(), regexp_replace(), regexp_replace_callback(), and regexp_split().


The documentation for this class was generated from the following file:

Generated on Mon Jul 14 10:55:47 2008 for Open Journal Systems by  doxygen 1.5.6