• 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

PHPMyAdmin not working as intended at remote server. Error 500, $respond not found

How to add a heading in between checkout fields of WooCommerce

Doctrine 2 mapping referencing unique key

Laravel Nova Dependency Container what are the allowed resource properties other than id in dependsOn

What is PHP's equivalent of JavaScript's "array.every()"?

(Laravel) How to delete multiple models including optional relationships?

Custom API and cunsuming in php?

Laravel Pagination links() not working

Access denied for user 'homestead'@'localhost' (using password: YES)

Display the default discounted price and percentage on Woocommerce products

How to use React Router with Laravel?

Combine multiple columns into an array as one of the key in a results set

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

get folder directory from input type file - PHP

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

About Contact Privacy policy Terms and conditions