intl Functions
PHP Manual

grapheme_substr

(No version information available, might be only in CVS)

grapheme_substr — Return part of a string

Description

Procedural style

int grapheme_substr ( string $string , int $start [, int $length ] )

Return part of a string 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. 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.

Parameters

string

The input string.

start

If start is non-negative, the returned string will start at the

length

If length is given and is positive, the string returned will contain

Return Values

Returns the extracted part of string.

Examples

Example #1 grapheme_substr() example

< ?php
TODO
?>

The above example will output:

         
TODO

See Also

TODO


intl Functions
PHP Manual