if (file_exists('path/to/file.txt')) { $fd = fopen('path/to/file.txt', 'r'); $size = fstat($fd)['size']; fclose($fd); echo "File size is $size bytes."; }
$file_url = 'http://example.com/file.zip'; $file = fopen($file_url, 'r'); $info = fstat($file); $file_type = mime_content_type($file_url); fclose($file); echo "File type is $file_type.";In both of these examples, PHP FD Info is used to get information about the file descriptor (`$fd` in example 1, `$file` in example 2) using the `fstat()` function. Then, in example 1, the size of the file is obtained from the file descriptor using `$size = fstat($fd)['size']`. In example 2, the MIME type of the file is determined using the `mime_content_type()` function. Based on the function names and descriptions, it is likely that PHP FD Info is part of the PHP standard library.