定制 juancamacho/php-sms 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

juancamacho/php-sms

Composer 安装命令:

composer require juancamacho/php-sms

包简介

PHP library for interacting with SMS functionality using Gammu

README 文档

README

This is a PHP library for interacting with SMS functionality using Gammu.

Table of Contents

Installation

Requirements

  • Runs on PHP 5.6 or above
  • Recomended PHP 7 or above
  • Gammu installed and configured
  1. Clone the repository:

    git clone https://github.com/your-username/sms-library.git
  2. Install the library dependencies using Composer:

    composer install

Usage

Initialize the SMS object

use SMS\SMS;

$sms = new SMS('/path/to/gammu', '/path/to/config', 'section_name');

Send an SMS

$number = '+1234567890';
$message = 'Hello, World!';

$response = '';
$sms->send($number, $message, $response);

if ($response) {
    echo "SMS sent successfully!\n";
} else {
    echo "Failed to send SMS.\n";
}

Delete an SMS

$folder = 'inbox';
$start = 1;
$stop = 10;

$response = '';
$sms->delete($folder, $start, $stop, $response);

if ($response) {
    echo "SMS deleted successfully!\n";
} else {
    echo "Failed to delete SMS.\n";
}

Get SMS Messages

$messages = $sms->getMessages();

// Process and display the messages
foreach ($messages as $folder => $messageList) {
    foreach ($messageList as $messageId => $message) {
        // Process individual message data
    }
}

Get Phonebook Contacts

$contacts = $sms->getPhoneBook();

// Process and display the contacts
foreach ($contacts as $index => $contact) {
    // Process individual contact data
}

Features

  • Send SMS messages
  • Delete SMS messages
  • Retrieve SMS messages
  • Access phonebook contacts

Contributing

Contributions are welcome! Here's how you can contribute:

  1. Fork the repository.
  2. Create a new branch.
  3. Make your changes.
  4. Test your changes.
  5. Submit a pull request.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-07-13