Array ausgeben

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

  • Array ausgeben

    Hallo,

    kan mir wer sagen wie ich aus folgender Lib die Arrays auslesen kann?

    PHP-Code:
                    $serverdata=substr($serverdata,7);
                    for (
    $i=1;$i<=$players;$i++) {
                            
    $playername =htmlspecialchars($this->getnextstring($serverdata));
                            
    $frags =$this->getnextfragvalue($serverdata);
                            
    $playtime =$this->getnextplaytime($serverdata);
                            
    $this->m_playerinfo[$i] =array("name"=>$playername,"frags"=>$frags,"time"=>$playtime);

                    }
                    
    // Sort players in fragorder
                    
    if ($players>1usort($this->m_playerinfo,"fragsort");
                    return 
    true
    Wir kann ich nun die Werte ausgeben?

    Danke für die Antworten.
    Gruß , Ag3nt

  • #2
    print_r?
    INFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |


    Kommentar


    • #3
      Deine sogenannte Lib sieht mir eher nach einer Klasse aus.

      schreib vor das return true; mal

      PHP-Code:
      echo "<pre>";
      print_r ($this->m_playerinfo); 
      Wenn das nicht hilft solltest du ggf. mal ein wenig mehr code preisgeben.
      gruss Chris

      [color=blue]Derjenige, der sagt: "Es geht nicht", soll den nicht stoeren, der's gerade tut."[/color]

      Kommentar


      • #4
        kommt soviel wie kann ich die werte denn einzelnd auslesen?

        Array ( [0] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [1] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [2] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [3] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [4] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [5] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [6] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [7] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [8] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [9] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [10] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [11] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [12] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [13] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [14] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [15] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [16] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [17] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [18] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [19] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [20] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [21] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [22] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [23] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [24] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [25] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [26] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [27] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [28] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [29] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [30] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [31] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [32] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [33] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [34] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [35] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [36] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [37] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [38] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [39] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [40] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [41] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [42] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [43] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [44] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [45] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [46] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [47] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [48] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [49] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [50] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [51] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [52] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [53] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [54] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [55] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [56] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [57] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [58] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [59] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [60] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [61] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [62] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [63] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [64] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [65] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [66] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [67] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [68] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [69] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [70] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [71] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [72] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [73] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [74] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [75] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [76] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [77] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [78] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [79] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [80] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [81] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [82] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [83] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [84] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [85] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [86] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [87] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [88] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [89] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [90] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [91] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [92] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [93] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [94] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [95] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [96] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [97] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [98] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [99] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [100] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [101] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [102] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [103] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [104] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [105] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [106] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [107] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [108] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [109] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [110] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [111] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [112] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [113] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [114] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [115] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [116] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [117] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [118] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [119] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [120] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [121] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [122] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [123] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [124] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [125] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [126] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [127] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [128] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [129] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [130] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [131] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [132] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [133] => Array ( [name] => [frags] => 0 [time] => 0m 0s ) [134] => Array ( [name] => & [frags] => 0 [time] => 0m 0s ) )
        Zuletzt geändert von AgentCyber; 24.10.2005, 20:48.
        Gruß , Ag3nt

        Kommentar


        • #5
          Kann mir den keiner sagen wir ich diese Daten abrufen kann?

          Sprich einzelnd aufrufen kann und als Tabelle ausgeben kann?
          Gruß , Ag3nt

          Kommentar


          • #6
            einfach mit einer foreach()-schleife. evtl diese auch noch schachteln. das siehst du ja in der stuktur der daten!
            INFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |


            Kommentar

            Lädt...
            X