Home >Backend Development >PHP Tutorial >php filesystem file system function usage
Note: If the file name ends with the correct suffix, this part will also be removed. chgrp — change the group a file belongs to chown — change the owner of a file chmod — change file mode bool chmod ( string $filename , int $mode ) Example 2:
copy — copy file
delete — see unlink or unset unlink — delete files Example 3:
disk_free_space — Returns the free space in a directory disk_total_space — Returns the total disk size of a directory diskfreespace — alias for disk_free_space Example 4:
///Result: The number of bytes returned 17433419776 32218386432 fopen — open a file or URL fgets — Read a line from a file pointer feof — Tests whether the file pointer reaches the end of the file fread — read a file (safe for binary files) fwrite — write to a file (safe for binary files) fclose — Close an open file pointer Example 5:
//Output: 1 - Welcome to my blog: 2 - http://bbs.it-home.org fgetc — Read characters from a file pointer fgetcsv — Read a line from a file pointer and parse CSV fields fgetss — Read a line from a file pointer and filter out HTML tags fputcsv — Format rows to CSV and write a file pointer fputs — alias for fwrite
1 2 Next page Last page |