![]() If you pass a negative number to the $length argument, the substr() function will omit a $length number of characters in the returned substring. Like the $offset argument, the $length argument can be negative. The following picture illustrates how the substr() function works in the above example: PHP substr() function with negative length ![]() In this example, the substr() returns a substring that at 4th character from the end of the string. The following example illustrates how to use the substr() function with negative offset:
0 Comments
Leave a Reply. |