php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #62800 Creating/modifying/deleting files in PHP
Submitted: 2012-08-12 01:29 UTC Modified: 2012-08-12 18:34 UTC
From: brandonskypimenta at gmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: Newest version of PHP OS: all
Private report: No CVE-ID: None
 [2012-08-12 01:29 UTC] brandonskypimenta at gmail dot com
Description:
------------
Any way to create files, delete files, modify files in PHP using these commands?

create_file creates a file.
modify_file edits a file's text.
delete_file immediately deletes a file. WARNING: Deletion will be permanent!
-----------------------------------------------------
© 2013

Test script:
---------------
<?php
create_file('FooBar.txt', 'Test');
modify_file('FooBar.txt', '-Test|+FooBar', '1');
delete_file('FooBar.txt');
?>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-08-12 01:31 UTC] brandonskypimenta at gmail dot com
fixed title
 [2012-08-12 01:31 UTC] brandonskypimenta at gmail dot com
-Summary: Create files, delete files, modify files +Summary: Creating/modifying/deleting files in PHP
 [2012-08-12 01:32 UTC] brandonskypimenta at gmail dot com
-PHP Version: Irrelevant +PHP Version: Newest version of PHP
 [2012-08-12 01:32 UTC] brandonskypimenta at gmail dot com
fixed php version
 [2012-08-12 07:25 UTC] anon at anon dot anon
>© 2013
Did you just copyright your inability to read documentation?
 [2012-08-12 07:28 UTC] brandonskypimenta at gmail dot com
All text in this bug is copyrighted by Brandon Sky, released under CC-BY 3.0.
 [2012-08-12 08:00 UTC] reeze dot xia at gmail dot com
Maybe this is helpful to you:
http://en.wikipedia.org/wiki/RTFM

OK, here is some funtions you might want:
http://php.net/file_put_contents
http://php.net/unlink
 [2012-08-12 18:34 UTC] nikic@php.net
-Status: Open +Status: Not a bug
 [2012-08-12 18:34 UTC] nikic@php.net
PHP already has numerous functions for these purposes.

See http://php.net/filesystem for a list.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 09 01:01:36 2024 UTC