PHP calls TextMagicAPI to send SMS _ PHP Tutorial

Source: Internet
Author: User
PHP calls TextMagicAPI to send text messages. PHP needs to use a third-party API to send text messages online. the following code calls TextMagicAPI to send text messages: viewsourceprint? 0102 introduce TextMagicPHP library file PHP for online text messaging. you need to use a third-party API. the following code calls TextMagic API to send text messages:

View sourceprint? 01

02 // introduce the TextMagic PHP library file

03 require ('textmagic-sms-api-php/TextMagicAPI. php ');

04 $ username = 'myusername ';

05 $ password = 'mypassword ';

06 $ router = new TextMagicAPI (array (

07 'username' => $ username,

08 'password' => $ password

09 ));

10 // send a message to '2017-345-5678'

11 $ result = $ router-> send ('Wake up! ', Array (2223455678), true );

12 // result (official materials): Array ([messages] => Array ([19896128] => 9991234567) [sent_text] => Wake up! [Parts_count] => 1)

13?>

If there is no TextMagic API class library, you can download here: TextMagic-SMS-API php sms module class

Using APIs to send text messages: view sourceprint? 01 02 // introduce the TextMagic PHP library file...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.