Sometimes we need to get the current URL location to build something inside our application, in fact, is very easy, just we have to use some Server and execution environment information variables in PHP: