• 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 change product Image when variables are selected in Shop and Archive Pages?

backup files to google drive using PHP

jwt decode throws Invalid argument supplied for foreach() on php-jwt and codeignitor 4

java URL working on browser but not in client program

array_map triple dimensional array [duplicate]

Check If array is null or not in php

Select option menu read from database and use it's values

PHPMetrics option --excluded-dirs="myfolder" : myfolder dir is not excluded within docker

How to create laravel storage symbolic link for production or sub domain system?

Return new collection without modifying original collection

How to make a foreign key not using primary key

array_key_exists(): The first argument should be either a string or an integer

Laravel MSSQL Server Connection not working

How do I remove this delivery notification from here?

How to get Laravel's CSRF Token from Another Website?

About Contact Privacy policy Terms and conditions