承接 webservis/goyercin-sms 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

webservis/goyercin-sms

Composer 安装命令:

composer require webservis/goyercin-sms

包简介

Simple PHP Example

README 文档

README

A PHP class to interact with the PostaGuvercini.com SMS API. This class allows you to send SMS messages through the PostaGuvercini service by using their HTTP API.

Features

  • Easy integration with the PostaGuvercini.com SMS API.
  • Supports sending SMS messages with customizable text and recipient numbers.
  • Handles API responses and provides error messages based on error codes.
  • Utilizes modern PHP 8.0 features like type hinting and constructor property promotion.
  • Exception handling for better error management.

Usage

  1. Initialize the class: First, you need to include the GoyercinSMS.php file in your project. You can do this by copying the content of the GoyercinSMS.php file into your project or by using Composer.

    composer require webservis/goyercin-sms

    #Basic Usage

    require_once 'vendor/autoload.php'; // Adjust this based on your project's structure
    
    use Webservis\GoyercinSMS;
    
    $user = "YOUR_USERNAME";
    $password = "YOUR_PASSWORD";
    $goyercinSMS = new GoyercinSMS($user, $password);
  2. Send an SMS:

    $gsm = "5329999999";
    $text = "Test message";
    $result = $goyercinSMS->sendSMS($gsm, $text);
    
    if ((int)$result['errno'] === 0) {
        echo "Message sent successfully.<br>";
        echo "Message ID: " . $result['message_id'] . "<br>";
        echo "Charge: " . $result['charge'] . "<br>";
    } else {
        $errorText = $goyercinSMS->getErrorText((int)$result['errno']);
        echo "Error sending message<br>";
        echo "Error Code: " . $result['errno'] . "<br>";
        echo "Description: " . $errorText . "<br>";
    }

Installation

  1. Ensure you have PHP 8.0 or higher installed.
  2. Download the GoyercinSMS class and include it in your project.

Requirements

  • PHP 8.0 or higher.
  • cURL extension enabled.

License

This project is licensed under the GNU GENERAL PUBLIC LICENSE.

统计信息

  • 总下载量: 20
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2024-05-16