"; if(($handle=fopen("script/$currCode.csv",'r'))!==FALSE){ while(($data=fgetcsv($handle,0,','))!==FALSE){ if(!$beginHead && !$endHead){ if($data[0]=="#"){ $xmlOutput = $xmlOutput."".$data[1].""; $beginHead = true; } } //in head if($beginHead && !$endHead){ if($data[0]=="#"){ $xmlOutput = $xmlOutput.""; $endHead = true; } else{ $xmlOutput = $xmlOutput."<".$data[0].">".$data[1].""; } } //in body if($beginHead && $endHead){ $xmlOutput = $xmlOutput . "".$data[0]."".$data[1].""; } } $xmlOutput = $xmlOutput . ""; } else{ $strError=$strError."can not open script/sinhala.csv "; } $xmlOutput = $xmlOutput . "".$strError.""; $xmlOutput = $xmlOutput . ""; echo $xmlOutput; ?>