Jump to content

Echo Last Part Of String


mattm1712

Recommended Posts

While I agree with Jessica's response as to why it doesn't work and how you can make it work with array_pop(), there is no reason to explode the string into an array. You can accomplish this with a simple string function: strrchr()

This function returns the portion of haystack which starts at the last occurrence of needle and goes until the end of haystack.

 

echo strrchr($occurrence->Description, ' ');

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.