• 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

Doctrine 2 mapping referencing unique key

PHP DOTENV unable to load env vars

possible options to create pdf file using html elements to generate invoice in php and codeigniter

Display the default discounted price and percentage on Woocommerce products

Use same method for inertia response and json response Laravel Jetstream

Unsure why I am getting: Number of variables doesn't match number of parameters in prepared statement

WooCommerce Subscriptions: Remove role on cancelled subscription

ORA-12546: TNS:permission denied error connection to remote oracle server

Creating live search with AJAX and CodeIgniter

dompdf and img tag, image wont show

What is my SQL missing?

PHP function Not Working As Expected From functions.php Include File

How do I do HTTP basic authentication using Guzzle?

php 7 php.ini upload_max_filesize not working

cakephp save drag and drop list order to database

About Contact Privacy policy Terms and conditions