How to delete a file via PHP?

How do I delete a file from my server with PHP if the file is in another directory? Here is my page layout: projects/backend/removeProjectData.php (this file deletes all my entries for the database and should also delete the related file) public_files/22.pdf (the place where the file is located.) I’m using the unlink function: unlink(‘../../public_files/’ . … Read more

In-place edits with sed on OS X

I’d like edit a file with sed on OS X. I’m using the following command: sed ‘s/oldword/newword/’ file.txt The output is sent to the terminal. file.txt is not modified. The changes are saved to file2.txt with this command: sed ‘s/oldword/newword/’ file1.txt > file2.txt However I don’t want another file. I just want to edit file1.txt. … Read more