Getting Portions of a String

Learn how to get a portion of an existing string.

The substr helper method

We can use the substr helper method to retrieve portions of an existing string. This helper defines a $start argument and an optional $length argument.

Get hands-on with 1200+ tech skills courses.