• 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

how to remove %20 in the url in php

Losing session data after POST from third party website

Symfony - "framework.test" config is not set to true

Add rows to Single product Additional information table in WooCommerce 3.6

array_map triple dimensional array [duplicate]

PHP Warning: Module already loaded in Unknown on line 0

Laravel Command Schedule Not Working Properly

How to get AJAX to post on second page?

PHP to search within txt file and echo the whole line

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

Laravel Displaying image from database

Declaration of OMDb::query(string $statement) must be compatible with PDO::query

Laravel set default language not working

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

PHP random string generator

About Contact Privacy policy Terms and conditions