substr
Returns a part (substring) of the given string starting at a given offset.
Basic usage
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
1 | int | yes | offset (zero based, can be negative) |
2 | int | no | length of substring returned (unlimited of omitted) |
Examples
When used with a negative offset, the substring starts n characters from the end of the string counting backwards.