1. Diese Seite verwendet Cookies. Wenn du dich weiterhin auf dieser Seite aufhältst, akzeptierst du unseren Einsatz von Cookies. Weitere Informationen

Notice: Undefined variable / Deprecated: Function split() is deprecated / Deprecated

Dieses Thema im Forum "PHP" wurde erstellt von drexxi, 24. Juni 2010.

  1. drexxi

    drexxi Grünschnabel

    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

    Code (Text):
    1. <?
    2. $sep = ";";
    3.  
    4. //define files to read
    5.  
    6. $file02 = "m0h.csv";    //Nullförderhöhe H
    7. $file03 = "m0i.csv";    //Nullförderhöhe I
    8. $file1 = "m1q.csv";     //Messpunkt 1 Q
    9. $file2 = "m1h.csv";     //Messpunkt 1 H
    10. $file3 = "m1i.csv";     //Messpunkt 1 I
    11. $file4 = "m2q.csv";     //Messpunkt 2 Q
    12. $file5 = "m2h.csv";     //Messpunkt 2 H
    13. $file6 = "m2i.csv";     //Messpunkt 2 I
    14. $file7 = "m3q.csv";     //Messpunkt 3 Q
    15. $file8 = "m3h.csv";     //Messpunkt 3 H
    16. $file9 = "m3i.csv";     //Messpunkt 3 I
    17. $file10 = "mbestq.csv"; //Bestellwert Q
    18. $file11 = "mbesth.csv"; //Bestellwert H
    19. $file12 = "mbesti.csv"; //Bestellwert I
    20. $file13 = "mspannung.csv"; //Betriebsspannung
    21. $file14 = "mfrequenz.csv"; //Betriebsfrequnz
    22. $file15 = "m4q.csv";     //Messpunkt 4 Q
    23. $file16 = "m4h.csv";     //Messpunkt 4 H
    24. $file17 = "m4i.csv";     //Messpunkt 4 I
    25. $file18 = "m5q.csv";     //Messpunkt 5 Q
    26. $file19 = "m5h.csv";     //Messpunkt 5 H
    27. $file20 = "m5i.csv";     //Messpunkt 5 I
    28. $file21 = "m6q.csv";     //Messpunkt 6 Q
    29. $file22 = "m6h.csv";     //Messpunkt 6 H
    30. $file23 = "m6i.csv";     //Messpunkt 6 I
    31. $file24 = "m2bestq.csv"; //Bestellwert Q
    32. $file25 = "m2besth.csv"; //Bestellwert H
    33.  
    34. // Chris Edit
    35.  
    36.  
    37. $file26 = "m7q.csv";     //Messpunkt 7 Q
    38. $file27 = "m7h.csv";     //Messpunkt 7 H
    39. $file28 = "m7i.csv";     //Messpunkt 7 I
    40. $file29 = "m8q.csv";     //Messpunkt 8 Q
    41. $file30 = "m8h.csv";     //Messpunkt 8 H
    42. $file31 = "m8i.csv";     //Messpunkt 8 I
    43.  
    44. //read the file into an array
    45.  
    46. $lines02 = file($file02);
    47. $lines03 = file($file03);
    48. $lines1 = file($file1);
    49. $lines2 = file($file2);
    50. $lines3 = file($file3);
    51. $lines4 = file($file4);
    52. $lines5 = file($file5);
    53. $lines6 = file($file6);
    54. $lines7 = file($file7);
    55. $lines8 = file($file8);
    56. $lines9 = file($file9);
    57. $lines10 = file($file10);
    58. $lines11 = file($file11);
    59. $lines12 = file($file12);
    60. $lines13 = file($file13);
    61. $lines14 = file($file14);
    62. $lines15 = file($file15);
    63. $lines16 = file($file16);
    64. $lines17 = file($file17);
    65. $lines18 = file($file18);
    66. $lines19 = file($file19);
    67. $lines20 = file($file20);
    68. $lines21 = file($file21);
    69. $lines22 = file($file22);
    70. $lines23 = file($file23);
    71. $lines24 = file($file24);
    72. $lines25 = file($file25);
    73.  
    74. // Chris Edit
    75.  
    76.  
    77. $lines26 = file($file26);
    78. $lines27 = file($file27);
    79. $lines28 = file($file28);
    80. $lines29 = file($file29);
    81. $lines30 = file($file30);
    82. $lines31 = file($file31);
    83.  
    84. //explode the second (1) line which will be the "Data" line
    85.  
    86. $m0hexp = explode($sep, $lines02[1]);
    87. $m0iexp = explode($sep, $lines03[1]);
    88. $m1qexp = explode($sep, $lines1[1]);
    89. $m1hexp = explode($sep, $lines2[1]);
    90. $m1iexp = explode($sep, $lines3[1]);
    91. $m2qexp = explode($sep, $lines4[1]);
    92. $m2hexp = explode($sep, $lines5[1]);
    93. $m2iexp = explode($sep, $lines6[1]);
    94. $m3qexp = explode($sep, $lines7[1]);
    95. $m3hexp = explode($sep, $lines8[1]);
    96. $m3iexp = explode($sep, $lines9[1]);
    97. $mbestqexp = explode($sep, $lines10[1]);
    98. $mbesthexp = explode($sep, $lines11[1]);
    99. $mbestiexp = explode($sep, $lines12[1]);
    100. $mspannungexp = explode($sep, $lines13[1]);
    101. $mfrequenzexp = explode($sep, $lines14[1]);
    102. $m4qexp = explode($sep, $lines15[1]);
    103. $m4hexp = explode($sep, $lines16[1]);
    104. $m4iexp = explode($sep, $lines17[1]);
    105. $m5qexp = explode($sep, $lines18[1]);
    106. $m5hexp = explode($sep, $lines19[1]);
    107. $m5iexp = explode($sep, $lines20[1]);
    108. $m6qexp = explode($sep, $lines21[1]);
    109. $m6hexp = explode($sep, $lines22[1]);
    110. $m6iexp = explode($sep, $lines23[1]);
    111. $mbestq2exp = explode($sep, $lines24[1]);
    112. $mbesth2exp = explode($sep, $lines25[1]);
    113. $date = substr("$m1qexp[1]",1,-9);
    114. $time = substr("$m1qexp[1]",11,-1);
    115. $date1 = substr("$m1qexp[1]",1,-9);
    116. $time1 = substr("$m1qexp[1]",11,-1);
    117. $date2 = substr("$m2qexp[1]",1,-9);
    118. $time2 = substr("$m2qexp[1]",11,-1);
    119. $date3 = substr("$m3qexp[1]",1,-9);
    120. $time3 = substr("$m3qexp[1]",11,-1);
    121.  
    122. // Chris Edit
    123.  
    124. $m7qexp = explode($sep, $lines26[1]);
    125. $m7hexp = explode($sep, $lines27[1]);
    126. $m7iexp = explode($sep, $lines28[1]);
    127. $m8qexp = explode($sep, $lines29[1]);
    128. $m8hexp = explode($sep, $lines30[1]);
    129. $m8iexp = explode($sep, $lines31[1]);
    130.  
    131. // replace "," with "."
    132.  
    133. $m0h = ereg_replace(',', '.', $m0hexp[2]);
    134. $m0i = ereg_replace(',', '.', $m0iexp[2]);
    135. $m1q = ereg_replace(',', '.', $m1qexp[2]);
    136. $m1h = ereg_replace(',', '.', $m1hexp[2]);
    137. $m1i = ereg_replace(',', '.', $m1iexp[2]);
    138. $m2q = ereg_replace(',', '.', $m2qexp[2]);
    139. $m2h = ereg_replace(',', '.', $m2hexp[2]);
    140. $m2i = ereg_replace(',', '.', $m2iexp[2]);
    141. $m3q = ereg_replace(',', '.', $m3qexp[2]);
    142. $m3h = ereg_replace(',', '.', $m3hexp[2]);
    143. $m3i = ereg_replace(',', '.', $m3iexp[2]);
    144. $m4q = ereg_replace(',', '.', $m4qexp[2]);
    145. $m4h = ereg_replace(',', '.', $m4hexp[2]);
    146. $m4i = ereg_replace(',', '.', $m4iexp[2]);
    147. $m5q = ereg_replace(',', '.', $m5qexp[2]);
    148. $m5h = ereg_replace(',', '.', $m5hexp[2]);
    149. $m5i = ereg_replace(',', '.', $m5iexp[2]);
    150. $m6q = ereg_replace(',', '.', $m6qexp[2]);
    151. $m6h = ereg_replace(',', '.', $m6hexp[2]);
    152. $m6i = ereg_replace(',', '.', $m6iexp[2]);
    153. $mbestq = ereg_replace(',', '.', $mbestqexp[2]);
    154. $mbesth = ereg_replace(',', '.', $mbesthexp[2]);
    155. $mbesti = ereg_replace(',', '.', $mbestiexp[2]);
    156. $mbestq2 = ereg_replace(',', '.', $mbestq2exp[2]);
    157. $mbesth2 = ereg_replace(',', '.', $mbesth2exp[2]);
    158. $mspannung = ereg_replace(',', '.', $mspannungexp[2]);
    159. $mfrequenz = ereg_replace(',', '.', $mfrequenzexp[2]);
    160.  
    161. // Chris Edit
    162.  
    163.  
    164. $m7q = ereg_replace(',', '.', $m7qexp[2]);
    165. $m7h = ereg_replace(',', '.', $m7hexp[2]);
    166. $m7i = ereg_replace(',', '.', $m7iexp[2]);
    167. $m8q = ereg_replace(',', '.', $m8qexp[2]);
    168. $m8h = ereg_replace(',', '.', $m8hexp[2]);
    169. $m8i = ereg_replace(',', '.', $m8iexp[2]);
    170.  
    171.  
    172. $m0h = number_format($m0h, 2, '.', '');
    173. $m0i = number_format($m0i, 2, '.', '');
    174. $m1q = number_format($m1q, 2, '.', '');
    175. $m1h = number_format($m1h, 2, '.', '');
    176. $m1i = number_format($m1i, 2, '.', '');
    177. $m2q = number_format($m2q, 2, '.', '');
    178. $m2h = number_format($m2h, 2, '.', '');
    179. $m2i = number_format($m2i, 2, '.', '');
    180. $m3q = number_format($m3q, 2, '.', '');
    181. $m3h = number_format($m3h, 2, '.', '');
    182. $m3i = number_format($m3i, 2, '.', '');
    183. $m4q = number_format($m4q, 2, '.', '');
    184. $m4h = number_format($m4h, 2, '.', '');
    185. $m4i = number_format($m4i, 2, '.', '');
    186. $m5q = number_format($m5q, 2, '.', '');
    187. $m5h = number_format($m5h, 2, '.', '');
    188. $m5i = number_format($m5i, 2, '.', '');
    189. $m6q = number_format($m6q, 2, '.', '');
    190. $m6h = number_format($m6h, 2, '.', '');
    191. $m6i = number_format($m6i, 2, '.', '');
    192. $mbestq = number_format($mbestq, 2, '.', '');
    193. $mbesth = number_format($mbesth, 2, '.', '');
    194. $mbesti = number_format($mbesti, 2, '.', '');
    195. $mbestq2 = number_format($mbestq2, 2, '.', '');
    196. $mbesth2 = number_format($mbesth2, 2, '.', '');
    197. $mspannung = number_format($mspannung, 0, '.', '');
    198. $mfrequenz = number_format($mfrequenz, 0, '.', '');
    199.  
    200. // Chris Edit
    201.  
    202. $m7q = number_format($m7q, 2, '.', '');
    203. $m7h = number_format($m7h, 2, '.', '');
    204. $m7i = number_format($m7i, 2, '.', '');
    205. $m8q = number_format($m8q, 2, '.', '');
    206. $m8h = number_format($m8h, 2, '.', '');
    207. $m8i = number_format($m8i, 2, '.', '');
    208.  
    209. ?>
    210.  

    Kann mir bitte jemand helfen?
  2. Yaslaw

    Yaslaw n/a Moderator

    Hab dein Code mal abgezählt. Auf Zeile 6 gibts keine Variable mbestq.

    Du solltest mal dein PHP-Tag von <? auf <?php wechseln. Je nach Einstellung kann dies zu Problemen führen
  3. drexxi

    drexxi Grünschnabel

    Zuletzt bearbeitet: 24. Juni 2010
  4. Yaslaw

    Yaslaw n/a Moderator

    [Sarkasmus]
    Mal sehen was in Zeile 66, 91, 92 und 104 steht..
    Ah klar, da fehlt ein !
    [/Sarkasmus]

    Sorry, aber ohne Code kann ich dir nicht helfen.
  5. timestamp

    timestamp Mitglied Käsekuchen


    Das bedeutet, dass dein array nicht den index 1 hat.

Diese Seite empfehlen