• 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

PHP array, move keys and values to new array, but mix it up

Laravel get user data with profile

Comma separated list from array with "and" before last element

Phpunit partial mock + proxy Entity

Unable to uninstall brew php from homebrew

Display specific shipping method if woocommerce product has specific acf field value

Normalize DateInterval in PHP

Additional price based on cart item count in WooCommerce

Show date difference as "20" instead of "20 years ago"

Get all WooCommerce products within own plugin

Undefined variable in Laravel 8 project (php 7.4)

Explode not working properly with dash

XSS attack still works despite htmlspecialchars() doing its work

How to change 'users' auth table and use another instead Laravel

I'm trying to use curl with php but getting this error:Could not resolve host: Bearer

About Contact Privacy policy Terms and conditions