Using new line tags: Newline characters \n or \r\n can be used to create a new line inside the source code.
write to text file"\n"; or echo "kings garden". "\n"; which adds a line break after the first line.
PHP's Command Line Interface (CLI) allows you to execute PHP scripts when logged in to your server through SSH. ServerPilot installs multiple versions of PHP on your server so there are multiple PHP executables available to run.
Use double quotes "
.
echo "next line\n";
Additional you can use the system-dependent constant PHP_EOL
echo "this is my text" . PHP_EOL;
Use double quotes instead. "
.
Escape sequences are only parsed when inside double quotes, not single quotes.
http://php.net/manual/en/language.types.string.php
Better not to concatenate anything in PHP, because it may lead to unexpected results, instead use a comma:
echo 'Text with new line' , PHP_EOL;
This will be faster too by the way: not concatenating and avoiding parsed double quotes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With