Hallo liebe Community.....
Ich hab ein Problem mit den Variablen eines alten PHP Skriptes...
Er liest sie mir einfach nicht aus den CSV Dateien...
Vielleicht könnt ihr mir helfen.....
Fehlermeldungen sind unteranderem:
Notice: Undefined variable: mbestq in C:\Steuerung\xampplite\htdocs\hp\diag.php on line 6
Deprecated: Function split() is deprecated in C:\Steuerung\xampplite\htdocs\hp\phplot.php on line 939
Deprecated: Function ereg_replace() is deprecated in C:\Steuerung\xampplite\htdocs\hp\phplot.php on line 938
Kann mir bitte jemand helfen?
Ich hab ein Problem mit den Variablen eines alten PHP Skriptes...
Er liest sie mir einfach nicht aus den CSV Dateien...
Vielleicht könnt ihr mir helfen.....
Fehlermeldungen sind unteranderem:
Notice: Undefined variable: mbestq in C:\Steuerung\xampplite\htdocs\hp\diag.php on line 6
Deprecated: Function split() is deprecated in C:\Steuerung\xampplite\htdocs\hp\phplot.php on line 939
Deprecated: Function ereg_replace() is deprecated in C:\Steuerung\xampplite\htdocs\hp\phplot.php on line 938
Code:
<?
$sep = ";";
//define files to read
$file02 = "m0h.csv"; //Nullförderhöhe H
$file03 = "m0i.csv"; //Nullförderhöhe I
$file1 = "m1q.csv"; //Messpunkt 1 Q
$file2 = "m1h.csv"; //Messpunkt 1 H
$file3 = "m1i.csv"; //Messpunkt 1 I
$file4 = "m2q.csv"; //Messpunkt 2 Q
$file5 = "m2h.csv"; //Messpunkt 2 H
$file6 = "m2i.csv"; //Messpunkt 2 I
$file7 = "m3q.csv"; //Messpunkt 3 Q
$file8 = "m3h.csv"; //Messpunkt 3 H
$file9 = "m3i.csv"; //Messpunkt 3 I
$file10 = "mbestq.csv"; //Bestellwert Q
$file11 = "mbesth.csv"; //Bestellwert H
$file12 = "mbesti.csv"; //Bestellwert I
$file13 = "mspannung.csv"; //Betriebsspannung
$file14 = "mfrequenz.csv"; //Betriebsfrequnz
$file15 = "m4q.csv"; //Messpunkt 4 Q
$file16 = "m4h.csv"; //Messpunkt 4 H
$file17 = "m4i.csv"; //Messpunkt 4 I
$file18 = "m5q.csv"; //Messpunkt 5 Q
$file19 = "m5h.csv"; //Messpunkt 5 H
$file20 = "m5i.csv"; //Messpunkt 5 I
$file21 = "m6q.csv"; //Messpunkt 6 Q
$file22 = "m6h.csv"; //Messpunkt 6 H
$file23 = "m6i.csv"; //Messpunkt 6 I
$file24 = "m2bestq.csv"; //Bestellwert Q
$file25 = "m2besth.csv"; //Bestellwert H
// Chris Edit
$file26 = "m7q.csv"; //Messpunkt 7 Q
$file27 = "m7h.csv"; //Messpunkt 7 H
$file28 = "m7i.csv"; //Messpunkt 7 I
$file29 = "m8q.csv"; //Messpunkt 8 Q
$file30 = "m8h.csv"; //Messpunkt 8 H
$file31 = "m8i.csv"; //Messpunkt 8 I
//read the file into an array
$lines02 = file($file02);
$lines03 = file($file03);
$lines1 = file($file1);
$lines2 = file($file2);
$lines3 = file($file3);
$lines4 = file($file4);
$lines5 = file($file5);
$lines6 = file($file6);
$lines7 = file($file7);
$lines8 = file($file8);
$lines9 = file($file9);
$lines10 = file($file10);
$lines11 = file($file11);
$lines12 = file($file12);
$lines13 = file($file13);
$lines14 = file($file14);
$lines15 = file($file15);
$lines16 = file($file16);
$lines17 = file($file17);
$lines18 = file($file18);
$lines19 = file($file19);
$lines20 = file($file20);
$lines21 = file($file21);
$lines22 = file($file22);
$lines23 = file($file23);
$lines24 = file($file24);
$lines25 = file($file25);
// Chris Edit
$lines26 = file($file26);
$lines27 = file($file27);
$lines28 = file($file28);
$lines29 = file($file29);
$lines30 = file($file30);
$lines31 = file($file31);
//explode the second (1) line which will be the "Data" line
$m0hexp = explode($sep, $lines02[1]);
$m0iexp = explode($sep, $lines03[1]);
$m1qexp = explode($sep, $lines1[1]);
$m1hexp = explode($sep, $lines2[1]);
$m1iexp = explode($sep, $lines3[1]);
$m2qexp = explode($sep, $lines4[1]);
$m2hexp = explode($sep, $lines5[1]);
$m2iexp = explode($sep, $lines6[1]);
$m3qexp = explode($sep, $lines7[1]);
$m3hexp = explode($sep, $lines8[1]);
$m3iexp = explode($sep, $lines9[1]);
$mbestqexp = explode($sep, $lines10[1]);
$mbesthexp = explode($sep, $lines11[1]);
$mbestiexp = explode($sep, $lines12[1]);
$mspannungexp = explode($sep, $lines13[1]);
$mfrequenzexp = explode($sep, $lines14[1]);
$m4qexp = explode($sep, $lines15[1]);
$m4hexp = explode($sep, $lines16[1]);
$m4iexp = explode($sep, $lines17[1]);
$m5qexp = explode($sep, $lines18[1]);
$m5hexp = explode($sep, $lines19[1]);
$m5iexp = explode($sep, $lines20[1]);
$m6qexp = explode($sep, $lines21[1]);
$m6hexp = explode($sep, $lines22[1]);
$m6iexp = explode($sep, $lines23[1]);
$mbestq2exp = explode($sep, $lines24[1]);
$mbesth2exp = explode($sep, $lines25[1]);
$date = substr("$m1qexp[1]",1,-9);
$time = substr("$m1qexp[1]",11,-1);
$date1 = substr("$m1qexp[1]",1,-9);
$time1 = substr("$m1qexp[1]",11,-1);
$date2 = substr("$m2qexp[1]",1,-9);
$time2 = substr("$m2qexp[1]",11,-1);
$date3 = substr("$m3qexp[1]",1,-9);
$time3 = substr("$m3qexp[1]",11,-1);
// Chris Edit
$m7qexp = explode($sep, $lines26[1]);
$m7hexp = explode($sep, $lines27[1]);
$m7iexp = explode($sep, $lines28[1]);
$m8qexp = explode($sep, $lines29[1]);
$m8hexp = explode($sep, $lines30[1]);
$m8iexp = explode($sep, $lines31[1]);
// replace "," with "."
$m0h = ereg_replace(',', '.', $m0hexp[2]);
$m0i = ereg_replace(',', '.', $m0iexp[2]);
$m1q = ereg_replace(',', '.', $m1qexp[2]);
$m1h = ereg_replace(',', '.', $m1hexp[2]);
$m1i = ereg_replace(',', '.', $m1iexp[2]);
$m2q = ereg_replace(',', '.', $m2qexp[2]);
$m2h = ereg_replace(',', '.', $m2hexp[2]);
$m2i = ereg_replace(',', '.', $m2iexp[2]);
$m3q = ereg_replace(',', '.', $m3qexp[2]);
$m3h = ereg_replace(',', '.', $m3hexp[2]);
$m3i = ereg_replace(',', '.', $m3iexp[2]);
$m4q = ereg_replace(',', '.', $m4qexp[2]);
$m4h = ereg_replace(',', '.', $m4hexp[2]);
$m4i = ereg_replace(',', '.', $m4iexp[2]);
$m5q = ereg_replace(',', '.', $m5qexp[2]);
$m5h = ereg_replace(',', '.', $m5hexp[2]);
$m5i = ereg_replace(',', '.', $m5iexp[2]);
$m6q = ereg_replace(',', '.', $m6qexp[2]);
$m6h = ereg_replace(',', '.', $m6hexp[2]);
$m6i = ereg_replace(',', '.', $m6iexp[2]);
$mbestq = ereg_replace(',', '.', $mbestqexp[2]);
$mbesth = ereg_replace(',', '.', $mbesthexp[2]);
$mbesti = ereg_replace(',', '.', $mbestiexp[2]);
$mbestq2 = ereg_replace(',', '.', $mbestq2exp[2]);
$mbesth2 = ereg_replace(',', '.', $mbesth2exp[2]);
$mspannung = ereg_replace(',', '.', $mspannungexp[2]);
$mfrequenz = ereg_replace(',', '.', $mfrequenzexp[2]);
// Chris Edit
$m7q = ereg_replace(',', '.', $m7qexp[2]);
$m7h = ereg_replace(',', '.', $m7hexp[2]);
$m7i = ereg_replace(',', '.', $m7iexp[2]);
$m8q = ereg_replace(',', '.', $m8qexp[2]);
$m8h = ereg_replace(',', '.', $m8hexp[2]);
$m8i = ereg_replace(',', '.', $m8iexp[2]);
$m0h = number_format($m0h, 2, '.', '');
$m0i = number_format($m0i, 2, '.', '');
$m1q = number_format($m1q, 2, '.', '');
$m1h = number_format($m1h, 2, '.', '');
$m1i = number_format($m1i, 2, '.', '');
$m2q = number_format($m2q, 2, '.', '');
$m2h = number_format($m2h, 2, '.', '');
$m2i = number_format($m2i, 2, '.', '');
$m3q = number_format($m3q, 2, '.', '');
$m3h = number_format($m3h, 2, '.', '');
$m3i = number_format($m3i, 2, '.', '');
$m4q = number_format($m4q, 2, '.', '');
$m4h = number_format($m4h, 2, '.', '');
$m4i = number_format($m4i, 2, '.', '');
$m5q = number_format($m5q, 2, '.', '');
$m5h = number_format($m5h, 2, '.', '');
$m5i = number_format($m5i, 2, '.', '');
$m6q = number_format($m6q, 2, '.', '');
$m6h = number_format($m6h, 2, '.', '');
$m6i = number_format($m6i, 2, '.', '');
$mbestq = number_format($mbestq, 2, '.', '');
$mbesth = number_format($mbesth, 2, '.', '');
$mbesti = number_format($mbesti, 2, '.', '');
$mbestq2 = number_format($mbestq2, 2, '.', '');
$mbesth2 = number_format($mbesth2, 2, '.', '');
$mspannung = number_format($mspannung, 0, '.', '');
$mfrequenz = number_format($mfrequenz, 0, '.', '');
// Chris Edit
$m7q = number_format($m7q, 2, '.', '');
$m7h = number_format($m7h, 2, '.', '');
$m7i = number_format($m7i, 2, '.', '');
$m8q = number_format($m8q, 2, '.', '');
$m8h = number_format($m8h, 2, '.', '');
$m8i = number_format($m8i, 2, '.', '');
?>
Kann mir bitte jemand helfen?