What is the purpose of the "\n" syntax in PHP and how does it affect output?

The "\n" syntax in PHP is used to create a new line in the output. It is a special character sequence that represents a line break. This can be useful when you want to format the output of your PHP script to make it more readable or structured.

<?php
// Using "\n" to create a new line in the output
echo "Hello, World!\n";
echo "This is a new line.";
?>