Created
December 17, 2014 23:02
-
-
Save Magnacarter/8052572d3d7cab2fc97f to your computer and use it in GitHub Desktop.
EZ File paths.
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