10-13-2003, 11:43 PM | #1 (permalink) | |
Huggles, sir?
Location: Seattle
|
[php] Fun with files (a pseudo-primer)
A friend was wondering how to handle deleting entries from a file, so I whipped up this little example. It uses a file called "file.txt" which contains the numbers one through nine, one on each line. The script reads in the file, removes three of the numbers (for sake of example), and then writes the new version of the file. It's not very pretty or well documented, but it should serve as a decent example of a way to manipulate files with PHP.
LINKY (zip format): http://www.seretogis.org/files/linka...nwithfiles.zip Contents of file.txt: Quote:
PHP Code:
__________________
seretogis - sieg heil perfect little dream the kind that hurts the most, forgot how it feels well almost no one to blame always the same, open my eyes wake up in flames |
|
Tags |
files, fun, php, pseudoprimer |
|
|