Ben bizim sisteme veri alabilirsiniz böylece bir diziye 6.000 hat 500 KB dosyayı ayrıştırmak çalışıyorum. Sorun komut yerde çizgiler 3000-4000 arasında yürütme durur olmasıdır. Kodda hiçbir sonları vardır, diğer ithalat üzerinde kullanabilirsiniz. Herhangi bir bu oluyor olabilir neden fikir ve ne bunu önlemek için ne yapabilirim?
/**
* Takes a seperated value string and makes it an array
* @param $delimiter string The delimiter to be seperated by, usually a comma or tab
* @param $string string The string to seperate
* @return array The resulting array
*/
public function svToArray ($delimiter, $string) {
$x = 0;
$rowList = array();
$splitContent = preg_split("#\n+#", trim($string));
foreach ($splitContent as $key => $value) {
$newData = preg_split("#".$delimiter."#", $value);
if ($x == 0) {
$headerValues = array_values($newData);
} else {
$tempRow = array();
foreach ($newData as $rowColumnKey => $rowColumnValue) {
$tempRow[$headerValues[$rowColumnKey]] = $rowColumnValue;
}
$rowList[] = $tempRow;
}
$x++;
}
return $rowList;
}
UPDATE: Error reporting is enabled. I've started using a file that's only 130KB at 1,500 lines and it does the same thing...
Ben echo "test<br/>"; sonra bir çıkış koymak sürece aşağıdaki örnekte hiçbir şey yankıları gibi hata ayıklama kodu eklediğinizde
public function svToArray ($delimiter, $string) {
$x = 0;
$rowList = array();
$splitContent = preg_split("#\n+#", trim($string));
echo "test<br/>";
foreach ($splitContent as $key => $value) {
$newData = preg_split("#".$delimiter."#", $value);
if ($x == 0) {
$headerValues = array_values($newData);
} else {
$tempRow = array();
foreach ($newData as $rowColumnKey => $rowColumnValue) {
$tempRow[$headerValues[$rowColumnKey]] = $rowColumnValue;
}
$rowList[] = $tempRow;
}
$x++;
}
echo "test";
$this->tru->debug($rowList);
exit;
return $rowList;
}
UPDATE
If I comment out $tempRow[] = $rowColumnValue; then it echoes everything fine....