PHP code example of esms / ideacurl

1. Go to this page and download the library: Download esms/ideacurl library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

esms / ideacurl example snippets




DEACURL\SMS;

$sms = new SMS('YOUR_API_KEY');

$response = $sms->send(
    '94771234567',
    'Hello from IDEACURL SMS!'
);

print_r($response);



DEACURL\SMS;

$sms = new SMS('YOUR_API_KEY');

$response = $sms->send(
    '94771234567',
    'Your OTP is 123456',
    'MYBRAND'
);

print_r($response);

new SMS(string $apiKey)

send(
    string $phone,
    string $message,
    string $mask = 'IDEACURL'
): array

try {
    $sms = new SMS('YOUR_API_KEY');

    $response = $sms->send(
        '94771234567',
        'Test Message'
    );
} catch (Exception $e) {
    echo $e->getMessage();
}