I need to be grabbing the URL of the current page in a Drupal site. It doesn't matter what content type it is - can be any type of node.
I am NOT looking for the path to theme, or the base url, or Drupal's get_destination. I'm looking for a function or variable that will give me the following in full:
http://example.com/node/number
Either with or without (more likely) the http://
.
This is what I found to be useful
Returns query strings and it's what's used in core: page_set_cache()
You can also do it this way:
It's a bit faster.
Try the following:
This method all is old method, in drupal 7 we can get it very simple
and another function with tiny difference
Maybe what you want is just plain old predefined variables.
Consider trying
Or read more here.
For Drupal 8 you can do this :