Multibyte Class Reference

Inheritance diagram for Multibyte:

Object List of all members.

Public Member Functions

 __codepoint ($decimal)
 __find ($char, $type= 'lower')

Static Public Member Functions

 ascii ($array)
 checkMultibyte ($string)
getInstance ()
 mimeEncode ($string, $charset=null, $newline="\r\n")
 stripos ($haystack, $needle, $offset=0)
 stristr ($haystack, $needle, $part=false)
 strlen ($string)
 strpos ($haystack, $needle, $offset=0)
 strrchr ($haystack, $needle, $part=false)
 strrichr ($haystack, $needle, $part=false)
 strripos ($haystack, $needle, $offset=0)
 strrpos ($haystack, $needle, $offset=0)
 strstr ($haystack, $needle, $part=false)
 strtolower ($string)
 strtoupper ($string)
 substr ($string, $start, $length=null)
 substrCount ($haystack, $needle)
 utf8 ($string)

Public Attributes

 $__caseFold = array()
 $__codeRange = array()
 $__table = null

Detailed Description

Definition at line 244 of file multibyte.php.


Member Function Documentation

Multibyte::__codepoint ( decimal  ) 

Return the Code points range for Unicode characters

Parameters:
interger $decimal
Returns:
string private

Definition at line 1030 of file multibyte.php.

Referenced by __find().

Multibyte::__find ( char,
type = 'lower' 
)

Find the related code folding values for $char

Parameters:
integer $char decimal value of character
string $type
Returns:
array private

Definition at line 1079 of file multibyte.php.

References __codepoint(), Configure::delete(), Configure::load(), and Configure::read().

Multibyte::ascii ( array  )  [static]

Converts the decimal value of a multibyte character string to a string

Parameters:
array $array
Returns:
string public

Definition at line 330 of file multibyte.php.

Referenced by stristr(), strrchr(), strrichr(), strstr(), strtolower(), strtoupper(), and substr().

Multibyte::checkMultibyte ( string  )  [static]

Check the $string for multibyte characters

Parameters:
string $string value to test
Returns:
boolean public

Definition at line 1114 of file multibyte.php.

References strlen().

Referenced by mimeEncode(), stripos(), stristr(), strlen(), strpos(), strripos(), strrpos(), and strstr().

& Multibyte::getInstance (  )  [static]

Gets a reference to the Multibyte object instance

Returns:
object Multibyte instance public

Definition at line 273 of file multibyte.php.

Referenced by strtolower(), and strtoupper().

Multibyte::mimeEncode ( string,
charset = null,
newline = "\r\n" 
) [static]

Prepare a string for mail transport, using the provided encoding

Parameters:
string $string value to encode
string $charset charset to use for encoding. defaults to UTF-8
string $newline
Returns:
string public
: add support for 'Q'('Quoted Printable') encoding

Definition at line 986 of file multibyte.php.

References checkMultibyte(), Configure::read(), strlen(), strtoupper(), and substr().

Multibyte::stripos ( haystack,
needle,
offset = 0 
) [static]

Find position of first occurrence of a case-insensitive string.

Parameters:
multi-byte string $haystack The string from which to get the position of the first occurrence of $needle.
multi-byte string $needle The string to find in $haystack.
integer $offset The position in $haystack to start searching.
Returns:
integer|boolean The numeric position of the first occurrence of $needle in the $haystack string, or false if $needle is not found. public

Definition at line 357 of file multibyte.php.

References checkMultibyte(), strpos(), and strtoupper().

Multibyte::stristr ( haystack,
needle,
part = false 
) [static]

Finds first occurrence of a string within another, case insensitive.

Parameters:
string $haystack The string from which to get the first occurrence of $needle.
string $needle The string to find in $haystack.
boolean $part Determines which portion of $haystack this function returns. If set to true, it returns all of $haystack from the beginning to the first occurrence of $needle. If set to false, it returns all of $haystack from the first occurrence of $needle to the end, Default value is false.
Returns:
int|boolean The portion of $haystack, or false if $needle is not found. public

Definition at line 377 of file multibyte.php.

References ascii(), checkMultibyte(), strtoupper(), and utf8().

Multibyte::strlen ( string  )  [static]

Get string length.

Parameters:
string $string The string being checked for length.
Returns:
integer The number of characters in string $string public

Definition at line 434 of file multibyte.php.

References checkMultibyte(), and utf8().

Referenced by checkMultibyte(), mimeEncode(), strtolower(), strtoupper(), and utf8().

Multibyte::strpos ( haystack,
needle,
offset = 0 
) [static]

Find position of first occurrence of a string.

Parameters:
string $haystack The string being checked.
string $needle The position counted from the beginning of haystack.
integer $offset The search offset. If it is not specified, 0 is used.
Returns:
integer|boolean The numeric position of the first occurrence of $needle in the $haystack string. If $needle is not found, it returns false. public

Definition at line 452 of file multibyte.php.

References checkMultibyte(), and utf8().

Referenced by stripos().

Multibyte::strrchr ( haystack,
needle,
part = false 
) [static]

Finds the last occurrence of a character in a string within another.

Parameters:
string $haystack The string from which to get the last occurrence of $needle.
string $needle The string to find in $haystack.
boolean $part Determines which portion of $haystack this function returns. If set to true, it returns all of $haystack from the beginning to the last occurrence of $needle. If set to false, it returns all of $haystack from the last occurrence of $needle to the end, Default value is false.
Returns:
string|boolean The portion of $haystack. or false if $needle is not found. public

Definition at line 497 of file multibyte.php.

References ascii(), and utf8().

Multibyte::strrichr ( haystack,
needle,
part = false 
) [static]

Finds the last occurrence of a character in a string within another, case insensitive.

Parameters:
string $haystack The string from which to get the last occurrence of $needle.
string $needle The string to find in $haystack.
boolean $part Determines which portion of $haystack this function returns. If set to true, it returns all of $haystack from the beginning to the last occurrence of $needle. If set to false, it returns all of $haystack from the last occurrence of $needle to the end, Default value is false.
Returns:
string|boolean The portion of $haystack. or false if $needle is not found. public

Definition at line 557 of file multibyte.php.

References ascii(), strtoupper(), and utf8().

Multibyte::strripos ( haystack,
needle,
offset = 0 
) [static]

Finds position of last occurrence of a string within another, case insensitive

Parameters:
string $haystack The string from which to get the position of the last occurrence of $needle.
string $needle The string to find in $haystack.
integer $offset The position in $haystack to start searching.
Returns:
integer|boolean The numeric position of the last occurrence of $needle in the $haystack string, or false if $needle is not found. public

Definition at line 617 of file multibyte.php.

References checkMultibyte(), strtoupper(), and utf8().

Multibyte::strrpos ( haystack,
needle,
offset = 0 
) [static]

Find position of last occurrence of a string in a string.

Parameters:
string $haystack The string being checked, for the last occurrence of $needle.
string $needle The string to find in $haystack.
integer $offset May be specified to begin searching an arbitrary number of characters into the string. Negative values will stop searching at an arbitrary point prior to the end of the string.
Returns:
integer|boolean The numeric position of the last occurrence of $needle in the $haystack string. If $needle is not found, it returns false. public

Definition at line 669 of file multibyte.php.

References checkMultibyte(), and utf8().

Multibyte::strstr ( haystack,
needle,
part = false 
) [static]

Finds first occurrence of a string within another

Parameters:
string $haystack The string from which to get the first occurrence of $needle.
string $needle The string to find in $haystack
boolean $part Determines which portion of $haystack this function returns. If set to true, it returns all of $haystack from the beginning to the first occurrence of $needle. If set to false, it returns all of $haystack from the first occurrence of $needle to the end, Default value is FALSE.
Returns:
string|boolean The portion of $haystack, or true if $needle is not found. public

Definition at line 720 of file multibyte.php.

References ascii(), checkMultibyte(), and utf8().

Multibyte::strtolower ( string  )  [static]

Make a string lowercase

Parameters:
string $string The string being lowercased.
Returns:
string with all alphabetic characters converted to lowercase. public

Definition at line 775 of file multibyte.php.

References ascii(), getInstance(), strlen(), substr(), and utf8().

Multibyte::strtoupper ( string  )  [static]

Make a string uppercase

Parameters:
string $string The string being uppercased.
string $encoding Character encoding name to use. If it is omitted, internal character encoding is used.
Returns:
string with all alphabetic characters converted to uppercase. public

Definition at line 823 of file multibyte.php.

References ascii(), getInstance(), strlen(), substr(), and utf8().

Referenced by mimeEncode(), stripos(), stristr(), strrichr(), and strripos().

Multibyte::substr ( string,
start,
length = null 
) [static]

Get part of string

Parameters:
string $string The string being checked.
integer $start The first position used in $string.
integer $length The maximum length of the returned string.
Returns:
string The portion of $string specified by the $string and $length parameters. public

Definition at line 952 of file multibyte.php.

References ascii(), and utf8().

Referenced by mimeEncode(), strtolower(), and strtoupper().

Multibyte::substrCount ( haystack,
needle 
) [static]

Count the number of substring occurrences

Parameters:
string $haystack The string being checked.
string $needle The string being found.
Returns:
integer The number of times the $needle substring occurs in the $haystack string. public

Definition at line 915 of file multibyte.php.

References utf8().

Multibyte::utf8 ( string  )  [static]

Converts a multibyte character string to the decimal value of the character

Parameters:
multibyte string $string
Returns:
array public

Definition at line 290 of file multibyte.php.

References strlen().

Referenced by JavascriptHelper::_utf8ToHex(), stristr(), strlen(), strpos(), strrchr(), strrichr(), strripos(), strrpos(), strstr(), strtolower(), strtoupper(), substr(), and substrCount().


Member Data Documentation

Multibyte::$__caseFold = array()

Definition at line 251 of file multibyte.php.

Multibyte::$__codeRange = array()

Definition at line 258 of file multibyte.php.

Multibyte::$__table = null

Definition at line 265 of file multibyte.php.


The documentation for this class was generated from the following file:
Generated on Sun Nov 22 00:30:56 2009 for CakePHP 1.2.x.x (v1.2.4.8284) by doxygen 1.4.7