Hàm fileinode() trả về số inode của file. Trả về FALSE nếu lỗi. Inode định danh duy nhất file trên filesystem (trùng inode = hard link cùng file).
Cú pháp
fileinode(file_path)
Tham số
file_path – File cần kiểm tra.
Giá trị trả về
Trả về inode number (integer). FALSE nếu lỗi.
Ví dụ
<?php
$file_path = 'new.php';
if (getmyinode() == fileinode($file_path)) {
echo 'This is your file!';
}
?>
Kết quả
This is your file!
Lưu ý: Trên Windows không có khái niệm inode chuẩn, kết quả có thể không đáng tin cậy. Kết quả bị cache.