PHP: URL path to file in same directory

<?php
$urlPathToFileInSameDirectory = (isset($_SERVER['HTTPS']) ? "https" : "http") . str_replace("THISFILENAME","","://$_SERVER[HTTP_HOST]$_SERVER[PHP_SELF]")."FILETOLOADNAME";
?>