PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Marco Bonzanini   File_Info   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: File_Info example script
Class: File_Info
Retrieve information about a file and its type
Author: By
Last change:
Date: 20 years ago
Size: 513 bytes
 

Contents

Class file image Download
<?php
/**
* File_Info class example
*
* more docs in README-(it|en).html
*/

require_once 'File_Info.php';

$file = '/home/marco/programma03-04.doc';

$f = new File_Info($file);

echo
$f->getName() . "\n";
echo
$f->getExtension() . "\n";
echo
$f->getBasename() . "\n";
echo
$f->getPath() . "\n";
echo
$f->getDirname() . "\n";
echo
$f->getSize(FILE_INFO_SIZE_KB, 3) . "\n";
echo
$f->getSize() . "\n";
echo
$f->getMime() . "\n";
echo
$f->getType() . "\n";
echo
$f->getAtime() . "\n";
echo
$f->getMtime() . "\n";

?>