Hi I have a text file that I read in php and split it in arrays. After that i have a lot of arrays, and some of them are empty. How I delete these emty arrays and how I import the data in the mysql database? Connect is all there.
//$DatabaseHost = "localhost";
//$DatabaseUser = "xx";
//$DatabasePassword = "xxx";
//$Database = "xxxx";
//$Table = "xxxx";
//******** Datenbank Connect ********
//$DatabaseConnect = mysql_connect($DatabaseHost, $DatabaseUser, $DatabasePassword) or die ("Keine Verbindung zum Server");
//$DatabaseSelect = mysql_select_db($Database, $DatabaseConnect) or die ("Die Datenbank gibt es nicht");
$datei = file("daten/neuer0.txt");
foreach($datei AS $ausgabe)
{ $zerlegen = explode(",", $ausgabe); }
function multiexplode ($delimiters,$string) {
$ready = str_replace($delimiters, $delimiters[0], $string);
$launch = explode($delimiters[0], $ready);
return $launch;
}
$text = $ausgabe;
{
$exploded = multiexplode(array(",",".","|",":","\"","\\",),$text);
print_r($exploded);