trying to write an array to a text file, but it is failed, can anybody say, WHY?
$filename= 't12a';
for ($pnum = 1; $pnum <= 15; $pnum++){
$bbal = 3;
$ipmnt = 14 * 5;
$ppmnt = 26 - 7;
$ebal = 48 - 4;
$ccint = 54 + 45;
$cpmnt = 25 + 54;
$db_data_txt[] = array('pn' => $pnum, 'bb' => sprintf("%01.2f",$bbal),'ip'=>sprintf("%01.2f",$ipmnt),'pp'=>sprintf("%01.2f",$ppmnt),'eb'=>sprintf("%01.2f",$ebal),'ci'=>sprintf("%01.2f",$ccint),'cp'=>sprintf("%01.2f",$cpmnt));
}
$con= $db_data_txt;
if ( ! write_file("./files/{$filename}.doc", $con))
{
echo 'Unable to write the file';
}
else
{
echo 'File written!';
}