Datei auslesen => ergibt doppelte Einträge

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

  • Datei auslesen => ergibt doppelte Einträge

    Hi,


    hab ne Textdatei in der steht:


    2.1.1|Text|Text|Text||Text|Text|Text|Text|Text| | |Text|Text|Text|Text|Text|Text| | |||


    lass so auslesen:

    PHP-Code:
        $dummyfile="dummy2.txt";
        
    $dateidummy=file($dummyfile);

        for(
    $i=0$i<count($dateidummy); $i++)
        {
          
    $dummyArray=explode("|"$dateidummy[$i]);
          
    array_push($mittelTeil$dummyArray);
        }

        for(
    $i=0$i<count($mittelTeil);$i++)
        {
           
    $gesamtneu[]=$mittelTeil[$i];
        } 
    bei ausgabe

    PHP-Code:
     print_r($gesamtneu); 
    sagt er mir:

    Array
    (
    [0] => Array
    (
    [0] => 2.1.1
    [1] =>
    [2] => Text
    [3] => Text
    [4] => Text
    [5] =>
    [6] => Text
    [7] => Text
    [8] => Text
    [9] => Text
    [10] => Text
    [11] =>
    [12] =>
    [13] => Text
    [14] => Text
    [15] => Text
    [16] => Text
    [17] => Text
    [18] => Text
    [19] =>
    [20] =>
    [21] =>
    [22] =>
    [23] =>

    )

    )
    Array
    (
    [0] => Array
    (
    [0] => 2.1.1
    [1] =>
    [2] => Text
    [3] => Text
    [4] => Text
    [5] =>
    [6] => Text
    [7] => Text
    [8] => Text
    [9] => Text
    [10] => Text
    [11] =>
    [12] =>
    [13] => Text
    [14] => Text
    [15] => Text
    [16] => Text
    [17] => Text
    [18] => Text
    [19] =>
    [20] =>
    [21] =>
    [22] =>
    [23] =>

    )

    [1] => Array
    (
    [0] => 2.1.1
    [1] =>
    [2] => Text
    [3] => Text
    [4] => Text
    [5] =>
    [6] => Text
    [7] => Text
    [8] => Text
    [9] => Text
    [10] => Text
    [11] =>
    [12] =>
    [13] => Text
    [14] => Text
    [15] => Text
    [16] => Text
    [17] => Text
    [18] => Text
    [19] =>
    [20] =>
    [21] =>
    [22] =>
    [23] =>


    )

    )

    obwohl nur 1 Mal vorhanden.

    wieso?
    Zuletzt geändert von Schlafmütze; 09.05.2006, 09:03.
    carpe noctem

    schon wieder ist es Tag!!!!

  • #2
    mach mal n paar testausgaben um deinen code nachzuvollziehen.

    Kommentar

    Lädt...
    X