Created
December 17, 2014 06:59
-
-
Save Magnacarter/94dd9dc575e75a0626bc to your computer and use it in GitHub Desktop.
EZ File Path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
*use this for file paths. | |
*@param string | |
* | |
*@return string | |
*/ | |
function ez_file_path( $file ) { | |
$host = $_SERVER[ "HTTP_HOST" ]; | |
$path = rtrim ( dirname( $_SERVER[ "PHP_SELF" ] ), "/\\" ); | |
return "http://$host$path/$file"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment