PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Juan Camacho   PHP SMS Sender   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: PHP SMS Sender
Send, receive and delete SMS messages using Gammu
Author: By
Last change:
Date: 10 months ago
Size: 1,998 bytes
 

Contents

Class file image Download

SMS Library

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.