Write some text to a text file named "test.txt":

Started by KingSparta, Dec 16, 2023, 02:17 PM

Previous topic - Next topic

KingSparta

Write some text to a text file named "test.txt":

<?php
$number = 9;
$str = "Beijing";
$file = fopen("test.txt","w");
echo fprintf($file,"There are %u million bicycles in %s.",$number,$str);
?>
The output of the code above will be:

40
The following text will be written to the file "test.txt":

Ther