SyntaxFix
Write A Post
Hire A Developer
Questions
You can also do it this way:
$current_url = 'http://' .$_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
It's a bit faster.