• 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 do I remove this delivery notification from here?

shell errors running php exec

MySQL order by field in Eloquent

phpunit - mockbuilder - set mock object internal property

Updating and Synchronizing Woocommerce Subscriptions to Custom Date

Composer fails with kylekatarnls/update-helper on new homestead

How to trim a video by 4 fragments to 4 seconds using the PHP-FFMpeg?

Extract house numbers from address string

SlimExceptionHttpNotFoundException

PHP web3 ERC20 token function call

XSS attack still works despite htmlspecialchars() doing its work

Make Shipping Method fields Mandatory on Woocommerce checkout page

Merge key and value of array index [duplicate]

Check for PDO Results, If None Display Message, If Yes then Loop Through

Failing validation doesn't stop code execution in livewire component

About Contact Privacy policy Terms and conditions