Hàm filegroup() trong PHP - PHP Function

Code $filename = 'index.php'; print_r(posix_getgrgid(filegroup($filename)));

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

Hàm fileinode() trong PHP - PHP Function

Code $filename = 'index.php'; if (getmyinode() == fileinode($filename)) { echo 'You are checking the current file.'; }

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

Hàm filemtime() trong PHP - PHP Function

Code $filename = 'test.txt'; file_put_contents($filename, 'this a test string'); echo "$filename được tạo vào lúc: " .date ("F d Y H:i:s.", time()). "<br />"; sleep(15); $handle = fopen($filename, 'r+w'); fwrite($handle, 'Zaidap.com.nettttt'); fclose($handle); if ...

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

Hàm fileowner() trong PHP - PHP Function

Code $filename = 'index.php'; print_r(posix_getpwuid(fileowner($filename)));

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

Hàm fileperms() trong PHP - PHP Function

Code echo substr(sprintf('%o', fileperms('example.txt')), -4);

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

Hàm filesize() trong PHP - PHP Function

Code $filename = 'test.txt'; $size = filesize($filename); echo "kích thước của file $filename là: ". $size . "byte.";

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

Hàm filetype() trong PHP - PHP Function

Code echo filetype('test.txt') . "<br />"; echo filetype('./images/');

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

Hàm fopen() trong PHP - PHP Function

Code $handle = fopen("test.txt", "r"); $handle = fopen("index.php", "wb"); $handle = fopen("https://www.google.com.vn", "r");

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

Hàm fpassthru() trong PHP - PHP Function

Code file_put_contents('test.txt', 'Zaidap.com.net'); $fp = fopen('test.txt','rb'); fpassthru($fp);

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

Hàm fwrite() trong PHP - PHP Function

Code file_put_contents('test.txt', 'Zaidap.com.net'); $fp = fopen('test.txt','r+'); echo file_get_contents('test.txt') ."<br />"; echo "số kí tự đã ghi là: " . fwrite($fp, "examples") ."<br />"; echo file_get_contents('test.txt') ."<br />";

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

Hàm fputs() trong PHP - PHP Function

Code file_put_contents('test.txt', 'Zaidap.com.net'); $fp = fopen('test.txt','r+'); echo file_get_contents('test.txt') ."<br />"; echo "số kí tự đã ghi là: " . fputs($fp, "examples") ."<br />"; echo file_get_contents('test.txt') ."<br />";

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

Hàm fread() trong PHP - PHP Function

Code file_put_contents('test.txt', 'Zaidap.com.net'); $filename = "test.txt"; $handle = fopen($filename, "r"); echo $contents = fread($handle, 8); fclose($handle);

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

Hàm fseek() trong PHP - PHP Function

Code $fp = fopen('test.txt', 'r+'); echo ftell($fp) ." <br />"; fseek($fp, 5); echo ftell($fp);

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

Hàm fstat() trong PHP - PHP Function

Code $fp = fopen('test.txt', 'r+'); echo "<pre>"; print_r(fstat($fp)); echo "</pre>";

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

Hàm ftell() trong PHP - PHP Function

Code $fp = fopen('test.txt', 'r+'); echo ftell($fp) ." <br />"; fseek($fp, 5); echo ftell($fp);

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

Hàm ftruncate() trong PHP - PHP Function

Code $filename = 'test.txt'; file_put_contents($filename, "this is a test"); $handle = fopen($filename, 'r+'); ftruncate($handle, 10); echo fread($handle, filesize($filename)); fclose($handle);

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

Hàm glob() trong PHP - PHP Function

Code foreach (glob("*.txt" ) as $filename) { echo "$filename size " . filesize($filename) . "<br />"; }

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

Hàm is_dir() trong PHP - PHP Function

Code function checkdir( $path){ if (is_dir($path)) { return $path . " là một thư mục <br />"; }else{ return $path . " không phải một thư mục <br />"; } } echo checkdir("test.txt"); echo checkdir("css"); echo checkdir("files"); echo checkdir("something");

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

Hàm is_executable() trong PHP - PHP Function

Code function checkexEcutable( $path){ if (is_executable($path)) { return $path . " có thể thực thi <br />"; }else{ return $path . " không thể thực thi <br />"; } } echo checkexEcutable("test.txt"); echo checkexEcutable("css"); echo checkexEcutable("files");

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

Hàm is_file() trong PHP - PHP Function

Code function checkFile( $path){ if (is_file($path)) { return $path . " là một tập tin <br />"; }else{ return $path . " không phải một tập tin <br />"; } } echo checkFile("test.txt"); echo checkFile("css"); echo checkFile("something.txt");

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021