• 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

Make certain characters of a word from string bold

The sum of the user's points

Laravel Unknown Column 'updated_at'

PHP -> Next nearest date defined by array of days in week

I'm trying to use curl with php but getting this error:Could not resolve host: Bearer

How can I create a Download Page with post php method?

WordPress Subquery returns more than 1 row on SELECT

How to run a shell as root from php (apache)

how to make my own auto increment in php?

Magento 2 - How to add new block to admin panel in product page?

I want to use codeigniter foreign character library in my custom PHP project how i can use it?

The difference when using if statement true === something() vs something() === true [duplicate]

Laravel csrf token mismatch for ajax POST Request

Display specific shipping method if woocommerce product has specific acf field value

how to get the header value, if we don't know the value because the value is random from the server

About Contact Privacy policy Terms and conditions