• 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

PHPExcel file download using AJAX call

PHP Get value from JSON [duplicate]

Check for PDO Results, If None Display Message, If Yes then Loop Through

Sum column values from multiple arrays

How to modify CSS in a specific page of the WP admin dashboard (backend)

How to redirect to another page and call a Function there on Angular ng-click

How to disable widget block editor of WordPress?

How to give apache permission to write to home directory?

printing all running session variable in laravel 5.1

calling server using nusoap with complextype

Why does using salted hash on python and php give me different results?

How can I make a full text index of the column?

Fatal error: Array callback has to contain indices 0 and 1

Laravel excel maatwebsite 3.1 import, date column in excel cell returns as unknown format number. How to solve this?

Update Order custom Field value with WooCommerce REST API

About Contact Privacy policy Terms and conditions