Contact: aviboots(AT)netvision.net.il
40,760 questions
53,134 answers
573 users
if (!($fp = fopen('d:\\data.txt', 'w'))) { echo "Error open file"; return; } $day = 18; $month = 6; $year = 2016; fprintf($fp, "%02d-%02d-%04d", $day, $month, $year); /* run: data.txt: --------- 18-06-2016 */
if (!($fp = fopen('d:\\data.txt', 'w'))) { echo "Error open file"; return; } $money = 1235.89; $character = fprintf($fp, '%01.2f', $money); echo "wrote $character bytes to data.txt"; // data.txt: // --------- // 1235.89 /* run: wrote 7 bytes to data.txt */