开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜