PHP code example of chenkby / yii2-mobile-validator

1. Go to this page and download the library: Download chenkby/yii2-mobile-validator 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/ */

    

chenkby / yii2-mobile-validator example snippets


    public function rules()
    {
        ...
        ['mobile', \chenkby\mobileValidator\MobilePhoneValidator::className()],
        ...
    }

    public function rules()
    {
        ...
        ['mobile', \chenkby\mobileValidator\MobilePhoneValidator::className(), 'serverRegex' => "/^1[1234567890]\d{9}$/", 'clientRegex' => "/^1[1234567890]\d{9}$/"],
        ...
    }