How do I get the url content of a webpage in PHP

by 2 replies
3
I need to access the url address of the page that is being loaded by my PHP script. Does anyone how to do this?

Thanks in advance
#programming #content #php #url #webpage
  • If you're talking about the address currently in the address bar of the browser, you can get it like this:
    PHP Code:
    $current_location $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; 
    This will not include anything after a hash mark (#) in the browser bar, because that information doesn't get sent to the server. It will also not include the current protocol being used (http:// or https://)
  • Research "System variables" (for PHP)

Next Topics on Trending Feed