Here is a nice way to grab the last item of an exploded string:
$my_string = ‘one-two-three-four’;
$last_item = end(explode( ‘-’, $my_string);
echo $last_item; // four
Categories
- Ecommerce & Shopping Carts (1)
- General (8)
- jQuery & Javascript (3)
- PHP and Mysql (1)
- Php Programming (1)
- Site Speed & Performance (6)
Menu
Search
- Configure it from WP-Admin -> Settings -> GTranslate to see it in action.
Archives
Tags
Meta
Google news- Rave party: Police question Pune team's Sharma, Parnell - Deccan Herald 7:24am, May 21
- Cricketer Luke Pomersbach has confessed to his crime: Police - Hindustan Times 7:29am, May 21
- Black money probe: Pranab Mukherjee tables White Paper in Parliament - Times of India 7:01am, May 21
