Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

PHP help, Display contents of txt file then delete afterwards

EDIT: I have found a solution !


I've tried so many different ways, the closest i got was it would read the first character then delete the whole text file,

I want the full text file to be displayed then to delete it.

This is what i've got so far
PHP Code

<?php
    $myFile 
= "somefile.txt";
    
$fh = fopen($myFile, 'r');
    
$theData = fread($fh, 1);
    
fclose($fh);
    echo 
$theData;
    
?>     


<?php 
array_map
('unlink', glob("somefile.txt")); 
?>

^^ yes i know i'm shit with php


Possibly Related Threads...
Thread / Author Replies Views Last Post
by focussSep 16, 2019 11:34 AM 4 157 Sep 16, 2019 11:34 AM
Last Post: pastort
by SuperSupernaJul 31, 2018 01:33 AM 8 278 Jul 31, 2018 01:33 AM
Last Post: EliteTM
by hack3rconFeb 26, 2017 07:06 AM 11 254 Feb 26, 2017 07:06 AM
Last Post: Praet0rian