I have many files in a folder and wish to only list one of each date
these are the file names.
date format (dd/mm/yyy)
abc - 12-01-2009 - something.pdf
abc - 12-01-2009 - something else.pdf
abc - 12-01-2009 - another title.pdf
abc - 24-05-2009 - some other text
abc - 24-05-2009 - yet more files
abc - 24-05-2009 - yet another title.pdf
if i had these files then i would like the results to be
12-01-2009
24-05-2009
in an array
at present i have this script..
Code: $files = glob('agendas/*.pdf');
$sortfile = array();
foreach($files as $file){
//Extract date
if (preg_match('/(d+)-(d+)-(d+)[^.]*?.pdf/', $file, $reg)) {
//if (preg_match('/(d+)-(d+)-(d+)-Agenda Item (d+)[^.]*?.pdf/', $file, $reg)) {
//add date to array (file as key)
$sortfile[$file] = mktime(0,0,0,$reg[2],$reg[1],$reg[3]);
}
}
this only gets the files but i would like to have these files sorted and have only one of each date
how would this be done.
Members Only
Hi all, for my website i have a members area only which on members can veiw, but at the moment anyone can veiw them pages. Is there any way in which i can stop them veiwing the page without
removing space from the end of a variable
i have a variable $image which contains the following url "http://tiles.xbox.com/tiles/oo/P5/0mdsb2JgbA9ECgR8GgMfWSpVL2ljb24vMC84MDAwIAABAAAAAP3Wg70=.jpg"but for some reason it is breaking
Mail Form receiving emails with no content
Hi, I hope someone here can help me.I have a simple form in my website, it was working OK, after lots of trouble finding out how to make this form I managed to make it work.I had to create an
error reporting
hey everyoneI have a production server in which I want error reporting but only on some pagesI haveini_set('display_errors', 1);ini_set('log_errors', 1);ini_set('error_log',
mysql timestamp manipulation
How could I use a timestamp (e.g 2009-10-30 13:20:35 ), and with php find out if it is:from todayfrom this weekfrom this monthfrom the last 3 monthsfrom the last 6 monthsfrom this yearfrom 1 year
passing an array of objects after submit
How do I do this? This is what I have tried and it is not working.<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"><input
need help in creating captcha
hi i have a problem creating captcha system. i create some basic script for image displaying but it says this errorCode: The image “http://localhost/examples/captcha.php†cannot be
Good Programming and Web Design Books
Hi, I recived a pm today from a fellow phpfreaker regarding php books, i replied with the following, it may be of help to php peeps that are looking for a good book but are unsure of what to
PHP using IF to display error
i have a MySQL query and i want to display 1 thing only if the number of affected rows is >=1 and if not then display the error, here is what i have so far and nothing is being displayed ...
str_replace help
Hey there,I'm a PHP newb, I'm having troubles with the str_replace function. I want to clean up bad html to valid xhtml, I am using:Code: $pee = str_replace('&', '&amp;', $pee);It