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:
bei ausgabe
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?
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];
}
PHP-Code:
print_r($gesamtneu);
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?
Kommentar