$fp = fopen('../../data/result.txt', 'w'); fwrite($fp, $data1); fwrite($fp, '.'); fwrite($fp, $data2); fwrite($fp, '.'); fwrite($fp, $data3); fwrite($fp, '.'); fwrite($fp, $cata4); fclose($fp);