Jump to content

Getting Last Url Content


N-Bomb(Nerd)

Recommended Posts

Hello,

 

I have a string like such: http://logs.coolbeans.net/character/name/QAkHcdcSSjLfus

 

I'm trying to get the content after the last "/" (in this case: QAkHcdcSSjLfus). I tried using this as my expression, but it failed me "~http\://logs\.coolbeans\.net/character/name/(.*?)~".

 

When doing if(preg_match("~http\://logs\.coolbeans\.net/character/name/(.*?)~", $string, $results) the if expression is true, but $results won't contain the value I want.

 

How do I do this?

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/255585-getting-last-url-content/
Share on other sites

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.