Skip to content

Instantly share code, notes, and snippets.

@RobSpectre
Created November 16, 2011 16:15
Show Gist options
  • Select an option

  • Save RobSpectre/1370505 to your computer and use it in GitHub Desktop.

Select an option

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

sdeering commented Jul 1, 2015

Copy link
Copy Markdown

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