开发者

What does "//" (forward slash, forward slash) do in a PHP pathname?

开发者 https://www.devze.com 2023-01-12 22:45 出处:网络
I\'m looking at a bit of script and I\'m not sure what the开发者_C百科 \"//\" does. $ResultsFolder = \"./\" . \"Results\";

I'm looking at a bit of script and I'm not sure what the开发者_C百科 "//" does.

$ResultsFolder = "./" . "Results";
$CompanyFolder = $ResultsFolder."//".$CompanyName;


Doesn't do anything /./ and // mean the same thing than /


Beware: it doesn't do anything in a filesystem, but it will in browsers.

Example: your script is hosted at https://dummy.tld/folder/file.php, and containing the following:

<a href="[url, see below]">Link</a>

[url] could be:

example.txt -> https://dummy.tld/folder/example.txt
/example.txt -> https://dummy.tld/example.txt
//example.txt -> https://example.txt/

Note: this behaviour applies only if it starts with '//something', if you're using './/something', it will resolve to 'something'.

0

精彩评论

暂无评论...
验证码 换一张
取 消