PHP code example of cybersai / ussd-decision
1. Go to this page and download the library: Download cybersai/ussd-decision 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/ */
cybersai / ussd-decision example snippets
use Cybersai\UssdDecision\UssdDecision;
echo UssdDecision::using('0241122331') // Argument to use for decision making
->integer('It an integer') // Return this is the argument is an integer
->equal('0241122442', 'It my Number') // Return this is the argument is equal to the parameter given
->in(['05451111111', '05452222222'], 'It a schools line') // Return this is the argument is array provider
->length(6, 'Too short') // Return this is the argument length is 6
->phoneNumber('It a phone number') // Return this is the argument is a valid phone number
->any('Did not match any') // Just return this
->outcome(); // Give the outcome of the decision chain