我正在尝试使用filemtime
. 不幸的是,这对我的所有文件都失败了。我尝试过使用完整的完整路径(例如 www.mysite.com/images/file.png)。我试过只使用扩展名(例如/images/file.png)以及文件名本身(file.png)。没有任何工作。如何传递路径引用以便它可以找到我的文件?谢谢!
<br />n<b>Warning</b>: filemtime() [<a href='function.filemtime'>function.filemtime</a>]: stat failed for www.mysite.com/images/hills.png in <b>D:\Hosting\11347607\html\mobile\updateImages.php</b> on line <b>20</b><br
这是 php 脚本:
<?php
include '../scripts/connection.php';
//get information on this location from the database
$sql = "SELECT * FROM types";
$result = mysql_query($sql);
$array = array();
while ($row = mysql_fetch_array($result)) {
$path = $row['path'] . $row['picture_url'];
$last_mod = filemtime($path);
$this_file = array(
'filename' => $row['picture_url'],
'last_mod' => $last_mod
);
$array[$row['type']] = $this_file;
}
echo json_encode(array('result'=>'success', 'message'=>$array));
?>