What potential issue can arise when using fputs to write to a stream in PHP?
When using fputs to write to a stream in PHP, one potential issue that can arise is that fputs does not automatically append a newline character to the end of the string being written. This can result in the output being displayed without proper line breaks. To solve this issue, you can manually append a newline character ("\n") to the end of the string before writing it to the stream.
$file = fopen("output.txt", "w");
$string = "Hello, World!";
$string .= "\n"; // Append a newline character
fputs($file, $string);
fclose($file);