PHP code example of gabrielesbaiz / whatsapp-toolkit

1. Go to this page and download the library: Download gabrielesbaiz/whatsapp-toolkit 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/ */

    

gabrielesbaiz / whatsapp-toolkit example snippets


$whatsappToolkit = new Gabrielesbaiz\WhatsappToolkit();

echo $whatsappToolkit->url('+39 1234567890', '<p>Hallo world!</p>'); // https://api.whatsapp.com/send?phone=%2B39+1234567890&text=Hallo+world%21

use WhatsappToolkit;

WhatsappToolkit::url('+39 1234567890', '<p>Hallo world!</p>'); // https://api.whatsapp.com/send?phone=%2B39+1234567890&text=Hallo+world%21
WhatsappToolkit::formatMessage('<p>Hallo world!</p>'); // Hallo+world%21
WhatsappToolkit::formatPhoneNumber('+39 1234567890'); // %2B39+1234567890