web 2.0

How to use PHP & Get File Properties

How to use PHP & Get File Properties Learn how to use the PHP to Get File Properties

ShotDev Focus:
- PHP & Get File Properties

Example

php_file_properties.php


<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<?php
$strFileName = "shotdev/my.txt";
$objFopen = fopen($strFileName,"r");
echo "Files Size = ".filesize($strFileName) . "<br>";
echo "Read able = ".is_readable($strFileName) . "<br>";
echo "Write able = ".is_writable($strFileName) . "<br>";
echo "Modify Date = ".date( "D d M Y g:i A", filemtime($strFileName)) . "<br>";
echo "Last Updated Time = ".date( "D d M Y g:i A", filemtime($strFileName)) . "<br>";

fclose ($objFopen);
?>
</body>
</html>

Create a php file and save to path root-path/myphp/

Run
http://localhost/myphp/php_file_properties.php

Screenshot

PHP Get File Properties
.
.
.

Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (1 votes, average: 1.00 out of 10)
Loading ... Loading ...

One Response to “How to use PHP & Get File Properties”

  1. 2presenting…

Leave a Reply

You must be logged in to post a comment.