Hi there,
I have a text file which contains values like this:
I use PHP to display the list, but at the moment it is displayed as each line is read (basically it's displayed as shown above)...is there a way to sort it by the date so it is displayed with the nearest events first? Here is the bit of code i use to simply display the list as it is at the moment:
Can anyone help?
I have a text file which contains values like this:
flatfile.txt said:15/10/2008 WS - Mr Tester. Some test details
04/11/2008 BH - Dr Feelgood. Some test details
12/11/2008 BH - Ms Test. Some test details
22/10/2008 BH - Mrs Jones. Some test details
30/09/2008 WS - Mr Smith. Some test details
01/10/2008 WS - Mr Pesky. Some test details
15/10/2008 WS - Mr Fitz. Some test details
I use PHP to display the list, but at the moment it is displayed as each line is read (basically it's displayed as shown above)...is there a way to sort it by the date so it is displayed with the nearest events first? Here is the bit of code i use to simply display the list as it is at the moment:
PHP:
<?php
$file_handle = fopen("../path/to/flatfile.txt", "rb");
while (!feof($file_handle) ) {
$line_of_text = fgets($file_handle);
echo '$line_of_text';
}
fclose($file_handle);
?>
Can anyone help?