Hàm filegroup() trong PHP - PHP Function
Code $filename = 'index.php'; print_r(posix_getgrgid(filegroup($filename)));
Hàm fileinode() trong PHP - PHP Function
Code $filename = 'index.php'; if (getmyinode() == fileinode($filename)) { echo 'You are checking the current file.'; }
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 ...
Hàm fileowner() trong PHP - PHP Function
Code $filename = 'index.php'; print_r(posix_getpwuid(fileowner($filename)));
Hàm fileperms() trong PHP - PHP Function
Code echo substr(sprintf('%o', fileperms('example.txt')), -4);
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.";
Hàm filetype() trong PHP - PHP Function
Code echo filetype('test.txt') . "<br />"; echo filetype('./images/');
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");
Hàm fpassthru() trong PHP - PHP Function
Code file_put_contents('test.txt', 'Zaidap.com.net'); $fp = fopen('test.txt','rb'); fpassthru($fp);
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 />";
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 />";
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);
Hàm fseek() trong PHP - PHP Function
Code $fp = fopen('test.txt', 'r+'); echo ftell($fp) ." <br />"; fseek($fp, 5); echo ftell($fp);
Hàm fstat() trong PHP - PHP Function
Code $fp = fopen('test.txt', 'r+'); echo "<pre>"; print_r(fstat($fp)); echo "</pre>";
Hàm ftell() trong PHP - PHP Function
Code $fp = fopen('test.txt', 'r+'); echo ftell($fp) ." <br />"; fseek($fp, 5); echo ftell($fp);
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);
Hàm glob() trong PHP - PHP Function
Code foreach (glob("*.txt" ) as $filename) { echo "$filename size " . filesize($filename) . "<br />"; }
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");
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");
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");







