Frage zu PHP ( Betrifft wohl die Einstellungen?!?)

Alles, was PHP betrifft, kann hier besprochen werden.

Frage zu PHP ( Betrifft wohl die Einstellungen?!?)

Postby ghost » 05. February 2007 11:48

Hab XAMPP installiert und unten stehende Skripte ausprobiert. Bei mir kommt jedoch nur:
Array
(
)


Bei anderen gehts jedoch Problemlos.

Woran könnte es liegen das es bei mir nicht korrekt ausgegeben wird?

Skripte:
<?
$handle = fopen("http://web0.plv-008-ffm3.ec-a.net/data/publicdata.php", "r");
$data = "";
while(!feof($handle)) $data .= fread($handle, 1024);
fclose($handle);
preg_match("/<table>(.*?)<\/table>/", $data, $result);
$strRep = array("</td>","</tr>");
$tableRow = explode("<tr>", str_replace($strRep, "", $result[1]));
$dataList = array();
for($pos=2;$pos<count($tableRow);$pos++) {
$tableData = explode("<td>", $tableRow[$pos]);
for($i=0;$i<=count($i);$i++) {
for($j=0;$j<10;$j++) $dataList[$pos-1][++$i] = $tableData[$i];
}
}
echo "<pre>";
print_r($dataList);
echo "</pre>";
?>

<?
$data = file_get_contents("http://web0.plv-008-ffm3.ec-a.net/data/publicdata.php");
preg_match("/<table>(.*?)<\/table>/", $data, $result);
$strRep = array("</td>","</tr>");
$tableRow = explode("<tr>", str_replace($strRep, "", $result[1]));
$dataList = array();
for($pos=2;$pos<count($tableRow);$pos++) {
$tableData = explode("<td>", $tableRow[$pos]);
for($i=0;$i<=count($i);$i++) {
for($j=0;$j<10;$j++) $dataList[$pos-1][++$i] = $tableData[$i];
}
}
echo "<pre>";
print_r($dataList);
echo "</pre>";
?>
ghost
 
Posts: 55
Joined: 17. January 2005 18:49

Postby Wiedmann » 05. February 2007 14:57

Bei anderen gehts jedoch Problemlos.

Was ist "bei anderen"
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby ghost » 05. February 2007 15:36

Bekannte dies auch mit XAMPP ausprobiert haben und bei denen folgendes als Ausgabe kam ist mit anderen gemeint:



Array
(
[1] => Array
(
[1] => 1
[2] => 1
[3] => 9
[4] => 1-01-09-Admin Iland
[5] => Cleaner2Dogs
[6] => 1747
[7] => [SL]
[8] => SeaLords
[9] => 29
[10] => 3871
)

[2] => Array
(
[1] => 1
[2] => 1
[3] => 14
[4] => 01:01:14
[5] => Robinson
[6] => 3286
[7] => [SL]
[8] => SeaLords
[9] => 29
[10] => 558
)

[3] => Array
(
[1] => 1
[2] => 2
[3] => 8
[4] => unbenannt
[5] => powerlord16
[6] => 4345
[7] =>
[8] =>
[9] =>
[10] => 1
)
...etc
ghost
 
Posts: 55
Joined: 17. January 2005 18:49

Postby Wiedmann » 05. February 2007 17:14

Woran könnte es liegen das es bei mir nicht korrekt ausgegeben wird?

An PHP 5.2.0.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby ghost » 05. February 2007 19:17

Und das heißt?
ghost
 
Posts: 55
Joined: 17. January 2005 18:49

Postby Wiedmann » 05. February 2007 19:28

Das das was du machst/machen willst mit PHP5.2.0 nicht geht.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby ghost » 05. February 2007 19:41

Und warum gehts damit nicht bzw. an welchem Teil liegts?
ghost
 
Posts: 55
Joined: 17. January 2005 18:49

Postby Wiedmann » 05. February 2007 19:53

bzw. an welchem Teil liegts?

An einer Einstellung beim Kompilieren der PCRE-Library.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby ghost » 05. February 2007 20:25

Sorry aber das sagt mir mom nichts. Was kann ich machen damits funzt?
Muß ich die Reg. Ausdrücke umändern, gibts ein Update für PHP, ....?
ghost
 
Posts: 55
Joined: 17. January 2005 18:49

Postby Wiedmann » 05. February 2007 20:44

Was kann ich machen damits funzt?

Kein PHP5.2.0 benutzen oder das Script umschreiben.

gibts ein Update für PHP

Nein. PHP5.2.0 ist die neueste Version.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby ghost » 06. February 2007 09:48

Gut, dann schreib ichs Skript um. Jetzt muß ich nur noch wissen an welchem Teil sich das neue PHP stört bzw. warum?
ghost
 
Posts: 55
Joined: 17. January 2005 18:49

Postby Wiedmann » 06. February 2007 13:02

etzt muß ich nur noch wissen an welchem Teil sich das neue PHP stört

An der Menge der Daten in "$data".
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby ghost » 07. February 2007 08:01

<?
$handle = fopen("http://web0.plv-008-ffm3.ec-a.net/data/publicdata.php", "r");
while(!feof($handle)) echo(fread($handle, 1024));
?>


Mit oben genannten Script wird der Inhalt korrekt ausgegeben, das würde ja dann heißen das php alles in $data aufnehmen kann später jedoch bei preg_match nicht weiter kommt. Kann preg_match nicht die die Menge an Daten verarbeiten oder liegts doch an was anderem?
ghost
 
Posts: 55
Joined: 17. January 2005 18:49

Postby Wiedmann » 07. February 2007 15:13

Kann preg_match nicht die die Menge an Daten verarbeiten

Genau.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany


Return to PHP

Who is online

Users browsing this forum: No registered users and 12 guests