I have a .txt
file that store all the information from my form. And I want to have 1 php that display status from the oldest date to today's date.
This is some example of my txt format:
ID4494 (tab("\t")) 12/02/2008 (tab("\t")) ANJAY
ID4496 (tab("\t")) 14/04/2009 (tab("\t")) SONJA
ID4499 (tab("\t")) 19/03/2014 (tab("\t")) BRIAN
and this is my php file
$myfilename = "../idfile/digid.txt";
if( file_exists($myfilename) && filesize($myfilename) > 0 ) {
$digArray = file($myfilename, FILE_IGNORE_NEW_LINES); sort($digArray); foreach($digArray as $dig) { $oneDigArray = explode("\t", $dig); echo "<p>$oneDigArray[0] - $oneDigArray[1] - $oneDigArray[2]</p>"; }
} else { echo "
There is no Digital ID.
"; }
I tried to use sort ($digArray[1]);
since the date is array no. 1. But it wont work.
Any suggestion?
Thank you.