Skip to content

Instantly share code, notes, and snippets.

@wisecrab
Created September 12, 2015 00:33
Show Gist options
  • Save wisecrab/b66380d80a65fb74420a to your computer and use it in GitHub Desktop.
Save wisecrab/b66380d80a65fb74420a to your computer and use it in GitHub Desktop.
//echo the current filename
echo basename(__FILE__);
//echo current filename without extension
echo basename(__FILE__, '.php');
//Echo the current URL
echo "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment