Demo. php:
<! -- Read content from a file, delete a data file, and re-write the deleted data to the file -->
<? PHP
$ AA = file_get_contents ('picinfo. db ');
$ BB = rtrim ($ AA ,'@');
// Var_dump ($ bb); exit;
$ Array = explode ('@', $ bb );
// Var_dump ($ array); exit;
/***** Test the following code: Open var_dump ($ CC); exit; and enable unset ($ array [0]) accordingly; ***/
// Unset ($ array [0]);
// Unset ($ array [1]);
// Unset ($ array [2]);
$ Cc = implode ('@', $ array );
If (! Empty ($ array )){
$ Cc = $ cc .'@@';
}
// Var_dump ($ CC); exit;
/*************************************** *******************************/
File_put_contents ('picinfo. db', $ CC );
?>
Picinfo. DB: (3 data entries in the array form] A -- B -- C)
A#%aa%%14146325652097.jpg%2014-10-30%17.jpg # image/JPEG # [email ### image/JPEG # [email ### image/JPEG # [email protected] @
Reads content from a file, deletes a data file, and writes the deleted data to the file again.