• 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

wp_remote_get() not passing authentication

Laravel Pagination links() not working

Jquery DataTables: Data not displaying in table via Ajax

PHP echo values of all sub keys [duplicate]

Sum column values from multiple arrays

Limit login attempts in Laravel 5.7

PHP date() with timezone?

PHP Include for HTML?

Too few arguments to function PendingResourceRegistration::name(),1 passed in C:xampphtdocsproject outesweb.php on line 18 and exactly 2 expected

virtctl works when executed via command line but not from php exec()

Why getting "Build step 'Execute shell' marked build as failure" error while creating a backup tar for files

IlluminateDatabaseQueryException: SQLSTATE[HY000]: General error: 1 no such table - In clone project

Two buttons one form

Laravel You requested 1 items, but there are only 0 items available

passwordless LDAP login and get user information using Kerberos ticket in PHP

About Contact Privacy policy Terms and conditions