fileatime လုပ်ဆောင်ချက်
fileatime လုပ်ဆောင်ချက်သည် ဖိုင်၏ နောက်ဆုံးဝင်ရောက်အသုံးပြုသည့်အချိန်ကို Unix timestamp အဖြစ် ပြန်ပေးသည်။ parameter တွင် ဖိုင်လမ်းကြောင်းကို ပေးပို့ရသည်။ ဖိုင်မရှိပါက လုပ်ဆောင်ချက်သည် false ကို ပြန်ပေးမည်။
ဝါကျဖွဲ့စည်းပုံ
fileatime(string $filename): int|false
ဥပမာ
ဖိုင်၏ နောက်ဆုံးဝင်ရောက်အသုံးပြုသည့်အချိန်ကို ရယူကြည့်ပါမည်။
<?php
$res = fileatime('test.txt');
echo $res;
?>
ကုဒ် run ပြီးနောက် ရလဒ်။
1672531200
ဥပမာ
ဝင်ရောက်အသုံးပြုသည့်အချိန်ကို ရယူခြင်းမပြုမီ ဖိုင်ရှိမရှိ စစ်ဆေးကြည့်ပါမည်။
<?php
$filename = 'nonexistent.txt';
if (file_exists($filename)) {
echo fileatime($filename);
} else {
echo 'File not found';
}
?>
ကုဒ် run ပြီးနောက် ရလဒ်။
'File not found'
ဥပမာ
Unix timestamp ကို ဖတ်ရှုနိုင်သောပုံစံသို့ ပြောင်းလဲကြည့်ပါမည်။
<?php
$timestamp = fileatime('test.txt');
echo date('Y-m-d H:i:s', $timestamp);
?>
ကုဒ် run ပြီးနောက် ရလဒ်။
'2023-01-01 00:00:00'