Hi David,
The function to grab the characters from the end is the same as to grab the characters from the beginning, except that you use negative values instead.
So, you'd use the following command
substr($test, -4);
to capture the string "cool".
There is a optional third argument to determine the length of the string, for example:
substr($test, 6, 6); should return "really".
Cheers,
David