1. Go to this page and download the library: Download subitosms/subitosms-php 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/ */
subitosms / subitosms-php example snippets
ubitoSMS\Client;
$sms = new Client('la-tua-username', 'la-tua-password');
$shipmentId = $sms->send(
'MIOBRAND',
'+393351234567',
'Ciao da SubitoSMS!'
);
echo "Spedizione: {$shipmentId}";
foreach ($sms->status($shipmentId) as $delivery) {
printf(
"%s — stato %d: %s%s",
$delivery->getDestination(),
$delivery->getStatus(),
$delivery->getDescription(),
PHP_EOL
);
if ($delivery->isTerminal()) {
// Stati terminali: -100, -50, 1, 16.
}
}
use SubitoSMS\Exception\ApiException;
use SubitoSMS\Exception\TransportException;
try {
$shipmentId = $sms->send('MIOBRAND', '+393351234567', 'Ciao');
} catch (TransportException $e) {
// Problema di rete/HTTPS: l'invio potrebbe non essere arrivato al gateway.
} catch (ApiException $e) {
// Risposta del gateway non valida o non accettata.
}
bash
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.