Skip to content

Instantly share code, notes, and snippets.

@freretuc
Created June 13, 2011 17:30
Show Gist options
  • Save freretuc/1023253 to your computer and use it in GitHub Desktop.
Save freretuc/1023253 to your computer and use it in GitHub Desktop.
Convert current path to http path
function get_current_path() {
return 'http://'. $_SERVER['SERVER_NAME'].'/'.str_replace($_SERVER['DOCUMENT_ROOT'],'',str_replace(basename(__FILE__)."##",'',__FILE__.'##'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment