LoginSignup
1

More than 5 years have passed since last update.

ファイル削除できない

Last updated at Posted at 2013-09-09
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset="utf-8" />
<title>ファイル削除</title>
</head>
<body>
<?php
$sD = date('Ymd', strtotime('-3 day')); // 3日前の日付
@mkdir($sD[0]);
$csv = ("http://www//files/$sD.csv");

if (file_exists($csv)) {
  if (unlink($csv)) {
    echo "<p>$csv を削除しました。</p>";
} else {
    echo "<p>$csv を削除できませんでした。</p>";
}
} else {
    echo "<p>$csv は存在しませんでした。</p>";
}
?>
</body>
</html>

上記ソースにて、日付を取得してファイルを削除したいのですが、
なぜか
....存在しないファイルです。
と、なります。
パーミッションの設定も済んでいるのですが、ほかに原因がわかりません。
ご教授願います。宜しくお願い致します。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1