PHP get file date php - Net-Raft.com

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




Just a Web Code Solution

get file date using php


 382

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 (%)
69%



The most helpful PHP solutions

detect browser phpdetect browser phpPHP

Click to see more ...

  3.5K     387

create QR code phpcreate QR code phpPHP

Click to see more ...

  2.2K     274

delete array item phpdelete array item phpPHP

Click to see more ...

  1.8K     231

create relative date phpcreate relative date phpPHP

Click to see more ...

  1.4K     216

detect ie phpdetect ie phpPHP

Click to see more ...

  1.1K     209

get current url phpget current url phpPHP

Click to see more ...

  685     188

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

Click to see more ...

  587     168

get meta tag phpget meta tag phpPHP

Click to see more ...

  513     128

detect speed internet phpdetect speed internet phpPHP

Click to see more ...

  502     106

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

Click to see more ...

  462     103