Array per multisort?!

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • Array per multisort?!

    Hallo Zusammen,

    habe mal wieder ein Prolem.
    Weis einer wie ic hdieses Array zu sortieren habe, damit ich REFERENCE_TIME aufsteigend sortiert bekomme?

    Mit

    array_multisort($erg[REFERENCE_TIME], SORT_NUMERIC, SORT_ASC);

    klappt es nicht!
    Auch nicht mit usort, oder hat einer eine Idee?

    Wo liegt mein Fehler im Syntax?! $erg ist mein Array was ich nach dem xml PArsen bekomme.


    PHP-Code:
    $xml = new XMLParser();
             
            foreach (
    $lin as $line) {
                    
                    
    $xml->input($line);
                 }
             
                
    $erg $xml->output();
             
                
    $log_output "<table border=\"1\">
                       <th bgcolor=\"#0e599c\"><font color=\"#FFFFFF\">CALLTYPE</font></th><th bgcolor=\"#0e599c\"><font color=\"#FFFFFF\">DATE        </font></th>" 
    "<th bgcolor=\"#0e599c\"><font color=\"#FFFFFF\">DURATION</font></th><th bgcolor=\"#0e599c\"><font color=\"#FFFFFF\">ERRO        R_CODE</font></th>" .
                       
    "<th bgcolor=\"#0e599c\"><font color=\"#FFFFFF\">CALLING_NUMBER</font></th><th bgcolor=\"#0e599c\"><font color=\"#FFFFFF        ">CALLED NUMBER</font></th>" .
                     "
    <th bgcolor="#0e599c\"><font color=\"#FFFFFF\">CALLING_IMEI</font></th><th bgcolor=\"#0e599c\"><font color=\"#FFFFFF\">        CALLED_IMEI</font></th>" .
                      
    "<th bgcolor=\"#0e599c\"><font color=\"#FFFFFF\">DIALLED_DIGITS</font></th><th bgcolor=\"#0e599c\"><font color=\"#FFFFFF        ">CALL_REFERENCE</font></th>";
            
                 foreach (
    $erg as $value) {
                    
    $log_output .= "<tr><td>{$value[CALLTYPE]}</td><td>{$value[REFERENCE_TIME]}</td>" .
                         "
    <td>{$value[DURATION]}</td><td>{$value[ERROR_CODE]}</td>" .
                        "
    <td>{$value[CONFORMED_CALLING_NUMBER]}</td><td>{$value[CONFORMED_CALLED_NUMBER]}</td>" .
                         "
    <td>{$value[CALLING_IMEI]}</td><td>{$value[CALLED_IMEI]}</td>" .
                       "
    <td>{$value[DIALLED_DIGITS]}</td><td>{$value[CALL_REFERENCE]}</td></tr>";
                   }
               
    $log_output .= "</table>";
            
            array_multisort(
    $erg[REFERENCE_TIME], SORT_NUMERIC, SORT_ASC); 


    danke!
    Zuletzt geändert von petro_0; 07.08.2006, 10:13.
    gruss pedro

  • #2
    kotz dein Code mal gemäß den Regeln um und entferne die Line Nr.

    PHP-Code:
    echo '<pre>';
    print_r($erg[REFERENCE_TIME]);
    echo 
    '</pre>';

    echo 
    '<pre>';
    print_r(array_multisort($erg[REFERENCE_TIME], SORT_NUMERICSORT_ASC););
    echo 
    '</pre>'
    Schon mal mit debuggen probiert? Und Code umkotzen!
    Zuletzt geändert von Benny-one; 07.08.2006, 10:17.
    Sunshine CMS
    BannerAdManagement
    Borlabs - because we make IT easier
    Formulargenerator [color=red]Neu![/color]
    Herkunftsstatistik [color=red]Neu![/color]

    Kommentar


    • #3
      $so_gehts

      und die variable
      PHP-Code:
      $so_gehts 
      ist dann
      PHP-Code:
      $log_output 
      oder eine neue variable die ich weiterverarbeite??


      sorry -> ich werde endlich mal die posting anweisungen lesen ;o))



      bin neuling...danke!


      ja geht net..es handelt sich um eine engine die immer läuft und nur beim laufen daten liefert! also eht kein debuggen in diesem Fall..
      Zuletzt geändert von petro_0; 07.08.2006, 10:27.
      gruss pedro

      Kommentar


      • #4
        also dann versuch ich mal.


        PHP-Code:
        $log_output array_multisort($erg[REFERENCE_TIME], SORT_NUMERICSORT_ASC); 
        gruss pedro

        Kommentar

        Lädt...
        X