Godaddy, Timestamps, and lots of craziness...lol

Discussion in 'PHP' started by jkashu, May 13, 2008.

  1. #1
    I need to sort array of dates:

    <?php
        $yourArray = array('12 Apr 2008, 10:22 am','15 Apr 2008, 08:22 am','7 Apr 2008, 10:22 am');
        
        foreach($yourArray as $date) {
            $unixTime = strtotime($date);
            $newArray[$unixTime] = $date;
        }
        
        ksort($newArray);
        
        foreach($newArray as $key => $value) {
            echo $value, '<br />';
        }
        
        /* Outputs
         * 7 Apr 2008, 10:22 am
         * 12 Apr 2008, 10:22 am
         * 15 Apr 2008, 08:22 am
        */
    ?>
    PHP:
    With my linux hosting from AFMU.com, this works perfectly, but with my Godaddy hosting, it only prints the first date. With Godaddy all timestamps end up being -1

    Thoughts???
     
    jkashu, May 13, 2008 IP