PHP Manual
substr
Description
string substr ( string string, int start [, int length] )
Returns the portion of string specified by the
start and length parameters.
Parameters
stringThe input string.
startIf
startis non-negative, the returned string will start at thestart'th position instring, counting from zero. For instance, in the string 'abcdef', the character at position 0 is 'a', the character at position 2 is 'c', and so forth.If
startis negative, the returned string will start at thestart'th character from the end ofstring.lengthIf
lengthis given and is positive, the string returned will contain at mostlengthcharacters beginning fromstart(depending on the length ofstring). Ifstringis less than or equal tostartcharacters long, FALSE will be returned.If
lengthis given and is negative, then that many characters will be omitted from the end ofstring(after the start position has been calculated when astartis negative). Ifstartdenotes a position beyond this truncation, an empty string will be returned.
Examples
Support PHPRO.ORG
Search
PHPRO.ORG Poll
Warning: Participation in PHPRO.ORG polls may incorrectly lead you to believe your opinions matter.

RSS Feed




