MySQL Access . 1990- PHP, CSV, .
, , . , : « ? , XML, ».
, , :
- (, ) BLOB ( ).
- (, ), .
- .
- . , . , . , (, , , ). .
, . PHP5. , .
:
PHP. .
. : fileatime(), filemtime() filectime().
<?php
$formatDate = "D d M Y g:i A";
$timeA = fileatime($file);
$timeM = filemtime($file);
$timeC = filectime($file);
echo $file . " " . date($formatDate, $timeA) . ".<br>";
echo $file . " i- " . date($formatDate, $timeM) . ".<br>";
echo $file . " " . date($formatDate, $timeC) . ".";
:
- C: Windowsfile.ini 19 2018 4:34 .
- C: Windowsfile.ini 8 2018 2:03 .
- C: Windowsfil.ini 16 2017 4:34.
filectime() , (, ), filemtime() - .
date() Unix, file*time() .
?
, PHP, is_file() is_dir(), , .
<?php
echo $file . (is_file($file) ? " " : " ") . " .<br>";
echo $file . (is_dir($file) ? " " : " ") . " .";
:
- C: Windowsfile.ini .
- C: Windowsfile.ini .
« ». PHP .
, . is_writable() is_readable().
<?php
echo $file . (is_readable($file) ? " " : " ") . " .<br>";
echo $file . (is_writable($file) ? " " : " ") . " .";
, .
:
- C: Windowsfile.ini .
- C: Windowsfile.ini .
, , .
, filesize(). .
<?php
$file = "C:\Windows\file.ini";$size = filesize($file);
echo $file . " " . $size . " .";
:
Windows . escape. , .
, filesize() False . file_exists().
<?php
$file = "C:\Windows\file.ini";if (file_exists($file)) { $size = filesize($file);
echo $file . " " . $size . " .";}else { echo $file . " .";}
file_exists() .
, , , . , .
PHP . file_get_contents(). . , , 1 PHP. «.ini»- file_get_contents() .
<?php
$file = "c:\windows\file.ini";$file1 = file_get_contents($file);
echo $file1;
, . , , , . fopen() .
<?php
$file = "c:\windows\file.ini";$file1 = fopen($file, "r");
fopen() :
, $file1. .
, fgets().
<?php
$file = "c:\windows\file.ini";$file1 = fopen($file, "r");
do { echo fgets($file1) . "<br>";}
while (!feof($file1));
fclose($file1);
do-while- , , . feof() , , , . fclose() .
fwrite(): «w» «a». «W» , , , «a» - , . , .
«a» .
<?php
$myFile = "files.txt";$file1 = fopen($myFile, "a");
$output = "" . PHP_EOL;fwrite($file1, $output);
$output = "" . PHP_EOL;
fwrite($file1, $output);
fclose($file1);
, «a» . , , $output fwrite(), . , , fclose().
PHP_EOL , , PHP .
:
file_put_contents() . , , FILE_APPEND, ( ).
, , file_put_contents().
<?php
$myFile = "files.txt";
file_put_contents($myFile, "" . PHP_EOL);
file_put_contents($myFile, "" . PHP_EOL, FILE_APPEND);
, . PHP .