fileinode() function in PHP


The fileinode() function returns the inode number of a file. The function returns the file’s inode number on success, whereas it returns FALSE on failure.

Syntax

fileinode(file_path)

Parameters

  • file_path − The file to be checked.

Return

The fileinode() function returns the file’s inode number on success, whereas it returns FALSE on failure.

The following is an example −

Example

<?php
   $file_path= new.php';
   if (getmyinode() == fileinode($file_path)) {
      echo 'This is your file!';
   }
?>

The following is the output −

Note − The result may vary on Windows system.

Output

This is your file!

Samual Sam
Samual Sam

Learning faster. Every day.

Updated on: 24-Jun-2020

81 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements