PHP get file date php - Net-Raft.com

Welcome aboard! We are happy you are here and wish you good net-raft!




Together We Can Simplify The World
Just a Web Code Solution

get file date using php


 319

PHP


2

<!DOCTYPE html>
<html>
<head>
</head>
<body>

<?php

function getFiledate($file) {
if (is_file($file)) {
$filePath = $file;
if (!realpath($filePath)) {
$filePath = $_SERVER["DOCUMENT_ROOT"].$filePath;
}
$fileDate = filemtime($filePath);
if ($fileDate) {
$fileDate = date('Y/m/d H:i:s',$fileDate);
return $fileDate;
}
return false;
}
return false;
}

$file = "Script.js";

echo getFiledate($file);

?>

</body>
</html>


By     Created   
The power of the user (%)
59%



The most helpful PHP solutions

detect browser phpdetect browser phpPHP

Click to see more ...

  2.4K     376

create QR code phpcreate QR code phpPHP

Click to see more ...

  1.8K     269

create relative date phpcreate relative date phpPHP

Click to see more ...

  1.3K     216

detect ie phpdetect ie phpPHP

Click to see more ...

  659     209

get current url phpget current url phpPHP

Click to see more ...

  528     189

Get real client country using php ?Get real client country using php ?PHP

Click to see more ...

  425     169

get meta tag phpget meta tag phpPHP

Click to see more ...

  349     129

detect speed internet phpdetect speed internet phpPHP

Click to see more ...

  320     105

How can I create an object using php ?How can I create an object using php ?PHP

Click to see more ...

  314     104

How to connect to MySQL database using PHP ?How to connect to MySQL database using PHP ?PHP

Click to see more ...

  157     72

Hi net-rafter,
create the complete solutions that will be
used by the developers from all around the world.

join us - click to create your account