Print
$dd=date("d-m-y") ;
//echo $dd;
$d=date('y');
$m=date('m');
//echo $d;
//$homepage = file_get_contents('pr03.txt');
//echo $homepage;
$file = 'pr03.txt';
// Open the file to get existing content
$current = file_get_contents($file);
//delete data from file
file_put_contents('pr03.txt', file_get_contents('php://input'));
// Append a new person to the file
$sr=$current;
$current_month=substr($current,2,2);
//echo 'Month-'.$current_month;
$current_sr=substr($current,4,6);
//echo'Sr '.$current_sr;
$current_sr=$current_sr+1;
if ($current_month!=$m)
{
$current_sr=000001;
}
// Write the contents back to the file
file_put_contents($file, $d.str_pad($m,2,'0',STR_PAD_LEFT).str_pad($current_sr,5,'0',STR_PAD_LEFT));
//file_put_contents($file, $person, FILE_APPEND | LOCK_EX);
//file_put_contents('pr03.txt', file_get_contents('php://input'));
fclose($file);
?>
No: 0000000
No: 0000000
No: 0000000
No: 0000000