$path = (@$_SERVER["HTTPS"] == "on") ? "https://" : "http://";
$path .=$_SERVER["SERVER_NAME"]. dirname($_SERVER["PHP_SELF"]);
I have this and this is what happens if I make a echo
echo $path
http:://localhost/folder
and without folder
http:://localhost/
if there is a folder not return my bar if I attached a bar as well the result without folder so
$path .=$_SERVER["SERVER_NAME"]. dirname($_SERVER["PHP_SELF"])."/";
echo $path
http:://localhost/folder
http:://localhost//
any idea better or more optimal to get what I want? to give me a single bar in the two cases