rednax Posted July 28, 2008 Share Posted July 28, 2008 I'm not sure how to go about this... I'll be taking the http_referrer on a page and I want the last chunk of the URL - if that makes sense. Example: HTTP_REFERRER will be http://www.domain.com/user/r3dn4x I need r3dn4x from that string, so how can I remove everything before it? Maybe just the regex(?) to grab everything after user/ and spit it back to me? Any help would be greatly appreciated!! Link to comment https://forums.phpfreaks.com/topic/117055-grabbing-last-part-of-a-url/ Share on other sites More sharing options...
trq Posted July 28, 2008 Share Posted July 28, 2008 <?php echo basename('http://www.domain.com/user/r3dn4x'); ?> Link to comment https://forums.phpfreaks.com/topic/117055-grabbing-last-part-of-a-url/#findComment-602078 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.