PHP sort an array on "Last Modified Date" with multiple dates the same error

I am producing a web page with a list of miscellaneous PDF documents. I want the list to be ordered by the last modified date in descending order. The problem I have is that some of the documents end up with the same time stamp. Apparently, PHP converts these time stamps into a number key for sorting and cannot deal with duplicates and items are dropped. I'm not a PHP guru so not sure how to deal with this
jsgouldAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ray PaseurCommented:
We need some more information to help you here -- specifically the test data set. (SSCCE)

To understand how PHP works with DATETIME values, please read this article, carefully for understanding.  It's amazingly easy once you understand the details.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_201-Handling-date-and-time-in-PHP-and-MySQL.html

PHP does not have anything inherent that can cause timestamps to be duplicates or cause items to be dropped.  There are standard programming practices that can prevent these sorts of problems.  Once we see the test data set, we can show you easy and dependable ways forward.
0
jsgouldAuthor Commented:
Ray:
you really don't need any test data. The issue is based on the windows file "Last Modified Date" of any document(s).
if you are interested in the issue, Take any number of documents with the exact same last modified date and sort them in an array in descending order.

if not I will be happy to award you all of the points since you are the first (and only) respondent.

Actually I solved the issue by creating a unique key from the date to ensure no dups.
Ciao!
0
Ray PaseurCommented:
Sorry, I don't have windows files with Last Modified Date information.  How do you get this information?  Is it in an array, for example?  If so, you can print the array with var_export() and post that information in the code snippet here.  Once we see the format and content of the data set, it will be a snap to give you a tested and working code sample that sorts the array.

OTOH, if you're already satisfied with your own results, you can post those here and accept your own solution as the answer. Then others who have a similar issue can learn from your research!

Best regards, ~Ray
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ray PaseurCommented:
Why did you give a marked-down grade?  Why not just post your solution and accept that as the answer?
http://support.experts-exchange.com/customer/portal/articles/481419
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.