我遇到了一個與php glob
函數有關的特性,並且想知道這是怎麼回事。php glob與scandir
<?php
$paths = glob('../test/*');
echo 'count = ' . count($paths) .'<br/>';
echo 'paths[0] = ' . $paths[0] .'<br/>';
echo 'scandir count = ' . count (scandir ('../test'));
?>
test目錄是空的,我得到的結果
count = 1
paths[0] =
scandir count = 2
的2 scandir
算我的理解(.
和..
計數太)。
但我預計計數爲$paths
爲0,而不是1.
爲什麼如果是1,$paths[0]
確實沒有價值?
什麼是PHP版本? –
PHP版本5.2.17 – Maestro13
從我看來很奇怪,我無法複製這個問題。 –