Key Takeaways
- Send SMS with PHP via HTTPS/JSON to the Android SMS gateway — not a “Complete PHP SDK” Composer product from us.
- Queue workers; keep request handlers thin; API keys in env.
- Idempotency keys stop duplicate OTP on retries.
- /codebase-php owns language samples; Developer Center owns live fields.
- Laravel/Symfony siblings share the same REST physics.
- BYO Android and operator credit. We meter devices and volume (Free 300 lifetime; paid from $19/mo).
Summary
Send SMS with PHP through an Android SMS gateway using REST. Hub: Android SMS Gateway API. Samples: PHP language samples. Docs: Developer Center. Laravel: Laravel send.
A Packagist package named “unlimited-sms-php” does not raise OEM ceilings or fund your prepaid SIM.
REST from PHP, not an SDK
Use curl or Guzzle with Authorization: Bearer from env. Confirm fields in Developer Center. Pair via setup.
// Conceptual — confirm URL/fields in Developer Center
$ch = curl_init($sendUrl);
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('SMS_GATEWAY_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'to' => $e164,
'text' => $body,
'client_ref' => $idempotencyKey,
]),
CURLOPT_TIMEOUT => 15,
]);Context
WordPress and custom PHP apps should enqueue sends — HTTP glue, not inline page render.
Send design
- Authorize in the web tier; send in a worker.
- Idempotency / client_ref on OTP.
- Timeouts + bounded retries; skip blind 4xx loops.
- Persist gateway message id.
- Webhook HMAC updates status async.
Layer table
| Layer | Owns | Must not |
|---|---|---|
| PHP web | AuthZ + enqueue | Blocking curl on page load |
| Worker | REST send | Log OTP plaintext |
| Webhook | HMAC + status | Trust unsigned POSTs |
| Phone | Radio + airtime | Hold API keys |
Each send spends airtime
Free 300 lifetime; paid from $19/mo. No Unlimited SMS titles. Pricing.
Operations
Watch queue depth and device last-seen. Canary before customer OTP.
HMAC and queues
Verify webhooks on the raw body. Env keys only.
Decision guide
Prefer REST samples over inventing an SDK. Frameworks differ; radio does not.
Checklist
- Env Bearer; queued send; idempotency.
- HMAC inbound; no SDK product claim.
- OTP pool isolated; no Unlimited SMS titles.
Next steps
Phone OTP use case: Android phone OTP verification.
Related product pages
Jump to the live product docs for this topic—not another long-form article.
- SMS API documentationLive endpoint reference
- PHP REST send samplesPHP code examples
- device and SMS volume pricingPlans and allowances
- Android SMS gateway product guideDefinition, product, and how to buy





