lstat()函數(shù)可以返回有關文件或符號鏈接的信息。
array lstat ( string $filename )
此函數(shù)可以收集以filename命名的文件或符號鏈接的統(tǒng)計信息,并且與stat()函數(shù)相同,不同之處在于,如果filename參數(shù)是符號鏈接,則返回符號鏈接的狀態(tài),而不是由符號指向的文件的狀態(tài)。符號鏈接。
<?php print_r(lstat("/PhpProject/sample.txt")); ?>
輸出結果
Array ( [0] => 1245376677 [1] => 1688849860635037 [2] => 33206 [3] => 3 [4] => 0 [5] => 0 [6] => 0 [7] => 49 [8] => 1588769151 [9] => 1590824960 [10] => 1588769151 [11] => -1 [12] => -1 [dev] => 1245376677 [ino] => 1688849860635037 [mode] => 33206 [nlink] => 3 [uid] => 0 [gid] => 0 [rdev] => 0 [size] => 49 [atime] => 1588769151 [mtime] => 1590824960 [ctime] => 1588769151 [blksize] => -1 [blocks] => -1 )PHP Filesystem 參考手冊