• 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 can I set a session variable in Drupal 8 and get it in a php script?

Class AppHttpControllersUserController Does Not Exist

add_action() function in wordpress not working [duplicate]

Whats the point of running Laravel with the command 'php artisan serve'?

GuzzleHttp Hangs When Using Localhost

Download & Save Zoom Recording in directory by PHP

How to get multiple values with same key from an array PHP

Laravel relationship belongsToMany with composite primary keys

how to remove %20 in the url in php

How can I get new CSRF token in LARAVEL by using ajax

Laravel 8 Multiple Relationships for Factory

phpseclib 2.0 can not use Composer to create autoload

WordPress Security Standards want me to escape my html, but how to do it correctly?

500 (Internal Server Error) with Laravel & Docker [duplicate]

Show rotation of tweets using current day of month

About Contact Privacy policy Terms and conditions