• 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

Can't find vendor/autoload.php for Ratchet

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

Laravel Route issues with Route order in web.php

Autoloading classes in PHPUnit using Composer and autoload.php

I want to store data in new index as per my key in php [duplicate]

Laravel views are showing from cache on one server but works fine on other server

In PHP, which is faster: preg_split or explode?

How can i update or reset my password without entering email field in laravel-8?

Access relation of pivot table in Laravel

Nginx disallowing execution of PHP in uploads directory with Magento

If action is on a different page do I use fwrite function

Docker image build with PHP zip extension shows "bundled libzip is deprecated" warning

Popup Window and PHP form

PHP header location absolute URL

Redis Command To Sort Keys

About Contact Privacy policy Terms and conditions