How to get last part from a URL string in php?

How can I read last part (after slash) of url if my url is like this:

http://testWeb.com/eng/pay-online/#__hc-action-complete--9d79883508

I've tried with $_GET and $_POST but these are empty. Also I've tried using $_SERVER['REQUEST_URI'] but it also return url till "pay-online". The project is in wordpress (in case there is something in WP which can solve this).

Upvotes: 1

Views: 1054

Answers (1)

Ryan
Ryan

Reputation: 1171

You can obtain the fragment using JS like: var fragment = location.hash.substring(1); // minus the hash

Upvotes: 1

Related Questions