I dont understand exactly your problem, but I send you a code of what I understand. If you want something else tell me and I'll try to help you.
<?php
$filename='txt.txt';
$f_data = file($filename);
foreach($f_data as $str)
if (is_integer(ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2})🙁[0-9]{1,2})🙁[0-9]{1,2}) : ([a-z'']{1,7})", $str, $matches)))
{
if(is_integer(strpos($matches[7],'')))
$var=substr($matches[7],(strpos($matches[7],'_')+1));
else
$var=$matches[7];
$$var='';
for($i=1;$i<4;$i++)
$$var.=$matches[$i].'-';
$$var=substr($$var,0,-1).' ';
for($i=4;$i<7;$i++)
$$var.=$matches[$i].':';
$$var=substr($$var,0,-1);
}
$sql = "INSERT INTO downuptable VALUES ('STP', '$down', '$up')";
echo $sql;
?>