• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

How to validate tin and cst using PHP?

php


PHP Snippet 1:

function validateFieldByRegex($regex , $string)
{
    if ( !preg_match($regex, $string) ) {
        echo 'incorrect string';
    } else {
        echo 'correct string';
    }
}

validateFieldByRegex('/^[1-9]([0-9]{1,10}$)/', '33392964390');
validateFieldByRegex('/^[1-9]([0-9]{1,6}$)/', '1280154');

PHP Snippet 2:

^(3[0-5]|[012][0-9]|[1-9])\d{9}$

Related Snippets

Cross-Origin Resource Sharing (CORS) witth Laravel and Vuejs

Laravel Sanctum CSRF not authenticating

Script @php artisan package:discover handling the post-autoload-dump event returned with error code 255

how to use extended ASCII instead of unicode in PHP

How to Make Laravel Eloquent "IN" Query?

how to fix Service provider class not found when using repository?

PHP - installing Xdebug on Mac with XAMPP (Unix File)

WooCommerce Subscriptions: Remove role on cancelled subscription

PHPExcel file download using AJAX call

phpMyAdmin ERROR: mysqli_real_connect(): (HY000/1045): Access denied for user 'pma'@'localhost' (using password: NO)

args[max_input] woocommerce if statement confused

CodeIgniter force_download is not working

Check if my GET request has Header: Token

hidden INPUT value not available in $_POST

Search for array row with specific column value and return another value from qualifying row

About Contact Privacy policy Terms and conditions