Working with file - PHP class

Started on the old forum in June 2011 · view the original in the archive · old links redirect here

2 replies · 895 views · started 15 years ago · 1 min read

2 participants
i0nutzxp Developer · 150 posts #1

UPDATE: FILE.CLASS.PHP 2.0

Because of $file::load() useless I rewrote the class, where I added some new things. Simple eg:

<?php
require('file.class.php');

$f = new file;

$filename = 'Folder/Folder2/Folder2/file.txt';

$f->validate($filename);

$f->write_file('HI', $filename, LINE_BY_LINE, ERASE); // LINE_BY_LINE | SINGLE_LINE  AND ERASE | DONT_ERASE

$array = $f->read_file($filename, ARRAY_READ); // OR FULL_READ

foreach ($array AS $a)
{
    echo $a.'<br/>';
}

$f->dir_tree('Folder/'); // will return an array with all files from that dir and its subdirs

$f->delete_dir('Folder/'); // all files and subfolders from Folder will be deleted
?>

TODO:
MYSQL LIKE FLAT FILE DATABASE system CLONE FILE MOVE POINTER IN FILE

Known Bugs: 0. Report it.

For more info read the comments from file.class.php or Tutorial.jpg

Thx;

<?php unlink('World/Europe/Romania.country'); ?>
Attachments: file.zip file.rar
i0nutzxp Developer · 150 posts #3

Class updated!

<?php unlink('World/Europe/Romania.country'); ?>

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close