PHP code example of zerochip / zimcell

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

    

zerochip / zimcell example snippets


use Zerochip\Zimcell 

Zimcell::refine('+263772 123 456');
Zimcell::refine('263772 123456');
Zimcell::refine('0772 123 456');
Zimcell::refine('0772123456');

// All the above return 772123456

Zimcell::intlFormat('0772 123 456');
// return +263772123456

ZimCell::valid('0772 123 456');
// returns true

ZimCell::valid('0872 12 34 56');
//returns false, refined number starts with an 8 i.e 872123456

Zimcell::valid('0772 12345');
// returns false, refined number will be 8 digits long i.e 77212345

Zimcell::is('econet', '0772 123 456');
// returns true

Zimcell::is('teleCash', '0772 123 456');
// returns false, note use of camelCase for provider name

Zimcell::is('netcel', '0772 123 456');
// returns null, netcel is not a supported provider

Zimcell::getProvider('0712123456');
// returns netone

Zimcell::getProvider('0812123456');
// returns null