Back to index

php5  5.3.10
Enumerations | Functions
grapheme_api.php File Reference

Go to the source code of this file.

Enumerations

enum  GRAPHEME_EXTR_COUNT
 grapheme_extract extract_type More...
enum  GRAPHEME_EXTR_MAXBYTES
 Extract as many whole grapheme clusters as will fit into the given number of bytes: More...
enum  GRAPHEME_EXTR_MAXCHARS
 Extract whole grapheme clusters up to a maximum number of UTF-8 characters: More...

Functions

 grapheme_strlen ($input)
 Get string length in grapheme units.
 grapheme_strpos ($haystack, $needle, $offset=0)
 Find position (in grapheme units) of first occurrence of a string.
 grapheme_stripos ($haystack, $needle, $offset=0)
 Find position (in grapheme units) of first occurrence of a case-insensitive string.
 grapheme_strrpos ($haystack, $needle, $offset=0)
 Find position (in grapheme units) of last occurrence of a string.
 grapheme_strripos ($haystack, $needle, $offset=0)
 Find position (in grapheme units) of last occurrence of a case-insensitive string.
 grapheme_substr ($string, $start, $length=-1)
 Return part of a string.
 grapheme_strstr ($haystack, $needle, $before_needle=FALSE)
 Returns part of haystack string from the first occurrence of needle to the end of haystack.
 grapheme_stristr ($haystack, $needle, $before_needle=FALSE)
 Returns part of haystack string from the first occurrence of case-insensitive needle to the end of haystack.
 grapheme_extract ($haystack, $size, $extract_type=GRAPHEME_EXTR_COUNT, $start=0, &$next)
 Function to extract a sequence of default grapheme clusters from a text buffer, which must be encoded in UTF-8.

Enumeration Type Documentation

grapheme_extract extract_type

    

Extract the given number of whole grapheme clusters from the string:

Definition at line 11 of file grapheme_api.php.

Extract as many whole grapheme clusters as will fit into the given number of bytes:

Definition at line 13 of file grapheme_api.php.

Extract whole grapheme clusters up to a maximum number of UTF-8 characters:

Definition at line 15 of file grapheme_api.php.


Function Documentation

grapheme_extract ( haystack,
size,
extract_type = GRAPHEME_EXTR_COUNT,
start = 0,
&$  next 
)

Function to extract a sequence of default grapheme clusters from a text buffer, which must be encoded in UTF-8.

Parameters:
string$haystackstring to search
int$sizemaximum number of units - based on the $extract_type - to return
[int]$extract_type one of GRAPHEME_EXTR_COUNT (default), GRAPHEME_EXTR_MAXBYTES, or GRAPHEME_EXTR_MAXCHARS
[int]$start starting position in $haystack in bytes
[&int]$next set to next starting position in bytes
Returns:
string A string starting at offset $start containing no more than $size grapheme clusters and ending on a default grapheme cluster boundary.

Definition at line 128 of file grapheme_api.php.

{}

Here is the caller graph for this function:

grapheme_stripos ( haystack,
needle,
offset = 0 
)

Find position (in grapheme units) of first occurrence of a case-insensitive string.

Parameters:
string$haystackThe string to look in
string$needleThe string to look for
[int]$offset The optional offset parameter allows you to specify which character in haystack to start searching. The position returned is still relative to the beginning of haystack.
Returns:
int Returns the position as an integer. If needle is not found, grapheme_stripos() will return boolean FALSE.

Definition at line 50 of file grapheme_api.php.

{}

Here is the caller graph for this function:

grapheme_stristr ( haystack,
needle,
before_needle = FALSE 
)

Returns part of haystack string from the first occurrence of case-insensitive needle to the end of haystack.

Parameters:
string$haystackThe input string.
string$needleThe string to look for.
[boolean]$before_needle If TRUE (the default is FALSE), grapheme_strstr() returns the part of the haystack before the first occurence of the needle.
Returns:
string Returns the portion of string, or FALSE if needle is not found.

Definition at line 115 of file grapheme_api.php.

{}

Here is the caller graph for this function:

grapheme_strlen ( input)

Get string length in grapheme units.

Parameters:
string$inputThe string being measured for length.
Returns:
int The length of the string on success, and 0 if the string is empty.

Definition at line 27 of file grapheme_api.php.

{}

Here is the caller graph for this function:

grapheme_strpos ( haystack,
needle,
offset = 0 
)

Find position (in grapheme units) of first occurrence of a string.

Parameters:
string$haystackThe string to look in
string$needleThe string to look for
[int]$offset The optional offset parameter allows you to specify which character in haystack to start searching. The position returned is still relative to the beginning of haystack.
Returns:
int Returns the position as an integer. If needle is not found, strpos() will return boolean FALSE.

Definition at line 38 of file grapheme_api.php.

{}

Here is the caller graph for this function:

grapheme_strripos ( haystack,
needle,
offset = 0 
)

Find position (in grapheme units) of last occurrence of a case-insensitive string.

Parameters:
string$haystackThe string to look in
string$needleThe string to look for
[int]$offset The optional offset parameter allows you to specify which character in haystack to start searching. The position returned is still relative to the beginning of haystack.
Returns:
int Returns the position as an integer. If needle is not found, grapheme_strripos() will return boolean FALSE.

Definition at line 74 of file grapheme_api.php.

{}

Here is the caller graph for this function:

grapheme_strrpos ( haystack,
needle,
offset = 0 
)

Find position (in grapheme units) of last occurrence of a string.

Parameters:
string$haystackThe string to look in
string$needleThe string to look for
[int]$offset The optional offset parameter allows you to specify which character in haystack to start searching. The position returned is still relative to the beginning of haystack.
Returns:
int Returns the position as an integer. If needle is not found, grapheme_strrpos() will return boolean FALSE.

Definition at line 62 of file grapheme_api.php.

{}

Here is the caller graph for this function:

grapheme_strstr ( haystack,
needle,
before_needle = FALSE 
)

Returns part of haystack string from the first occurrence of needle to the end of haystack.

Parameters:
string$haystackThe input string.
string$needleThe string to look for.
[boolean]$before_needle If TRUE (the default is FALSE), grapheme_strstr() returns the part of the haystack before the first occurence of the needle.
Returns:
string Returns the portion of string, or FALSE if needle is not found.

Definition at line 104 of file grapheme_api.php.

{}

Here is the caller graph for this function:

grapheme_substr ( string,
start,
length = -1 
)

Return part of a string.

Parameters:
string$stringThe input string.
int$startIf start is non-negative, the returned string will start at the start'th position in string, counting from zero. If start is negative, the returned string will start at the start'th character from the end of string.
[int]$length If length is given and is positive, the string returned will contain at most length characters beginning from start (depending on the length of string). If string is less than or equal to start characters long, FALSE will be returned. If length is given and is negative, then that many characters will be omitted from the end of string (after the start position has been calculated when a start is negative). If start denotes a position beyond this truncation, an empty string will be returned.
Returns:
int Returns the extracted part of string.

Definition at line 93 of file grapheme_api.php.

{}

Here is the caller graph for this function: