PHP code example of jieeit / phone

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

    

jieeit / phone example snippets




ieeit\Phone\Facade\Phone;

try {
    $info = Phone::find('13213000000');
    var_dump(json_encode($info, JSON_UNESCAPED_UNICODE));
} catch (InvalidArgumentException $e) {
    // 手机号段不存在
    echo '查询失败:' . $e->getMessage();
}