Skip to content

Instantly share code, notes, and snippets.

@RobSpectre
Created November 16, 2011 16:15
Show Gist options
  • Save RobSpectre/1370505 to your computer and use it in GitHub Desktop.
Save RobSpectre/1370505 to your computer and use it in GitHub Desktop.
Line break in a Twilio SMS
<?php
$ACCOUNT_SID = "ACxxxxxxxxxxxxxxxxxxxxxxxxxxx";
$AUTH_TOKEN = "yyyyyyyyyyyyyyyyyyyyyyyyyyyyy";
$TWILIO_NUMBER = "+1aaabbbcccc";
$TEST_NUMBER = "+1xxxyyyzzzz";
include 'Services/Twilio.php';
$client = new Services_Twilio($ACCOUNT_SID, $AUTH_TOKEN);
$client->account->sms_messages->create(
$TWILIO_NUMBER,
$TEST_NUMBER,
"This is a test with a linebreak.\n\n Totally."
);
?>
@sdeering
Copy link

sdeering commented Jul 1, 2015

Just to note you need to use double quoted PHP strings for this to work (else it just shows \n\n).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment