• 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

Pages are working fine on localhost but not running on the hosting server

CONCAT columns with Laravel 5 eloquent

Python - Include another Python script

Any AWS EB Laravel route getting 404 Not Found nginx/1.16.1

Yii2 select2 database exception number of bound variables does not match number of tokens

Clear javascript source cache laravel 5.8

How to get unique slug to same post-title for other time too?

laravel 5.6 bulk inserting json data

Nginx disallowing execution of PHP in uploads directory with Magento

Get Header Authorization value of a login api (sent with username and password in json body) using php curl

WHERE IN array binding in DB::raw laravel 5.4

PHP array_filter with arguments

Batch request Google Calendar php API

HTML + PHP + PHPMAILER

loop through an anchor id

About Contact Privacy policy Terms and conditions