I am working with an API of a certain sms service and I just want to know how to add a line break from php code in a plain text format to mobile?
Can someone help me?
I know this is an old question but anyway it might help someone.
I tend to use PHP_EOL
for this purposes (due to cross-platform compatibility).
echo "line 1".PHP_EOL."line 2".PHP_EOL;
If you're planning to show the result in a browser then you have to use "<br>"
.
$text = "This is line 1.\nThis is line 2.";
Be sure to use double quotes around the string, not single quotes.
If that's not working, you'll need to talk to the folks who made the API.
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