We have written a small PHP Hook for our billing system that opens a new support ticket with us when an order is placed. It works except that for the "Open Ticket" API function, it takes a string for the message, but we cannot figure out how to put carriage returns in it.
I have tried
<p>, <br>, \n, \r\n, etc.
As it appears to just be completely plain text though, all of these are just being read verbatim rather than made into carriage returns.
Does anyone have any thoughts on how this could be done? http://docs.whmcs.com/API:Open_Ticket
In Windows, a new line is denoted using “\r\n”, sometimes called a Carriage Return and Line Feed, or CRLF. Adding a new line in Java is as simple as including “\n” , “\r”, or “\r\n” at the end of our string.
The nl2br() function inserts HTML line breaks (<br> or <br />) in front of each newline (\n) in a string.
?> Using new line tags: Newline characters \n or \r\n can be used to create a new line inside the source code.
Carriage return is "\r"
. Mind the double quotes!
I think you want "\r\n"
btw to put a line break in your text so it will be rendered correctly in different operating systems.
There is also the PHP 5.0.2 PHP_EOL constant that is cross-platform !
Stackoverflow reference
PHP_EOL returns a string corresponding to the line break on the platform(LF, \n ou #10 sur Unix, CRLF, \n\r ou #13#10 sur Windows).
echo "Hello World".PHP_EOL;
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