• 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

SilverStripe unable to populate multiple member Childs

Add a custom text for a particular product on specific email notification in Woocommerce

how to hide previous markers when new markers added in google map javascript api

PHP file_get_contents function

500 Internal Server Error on Ajax request. Not sure the origin of the problem

How to connect to MSSQL Server with PHP from Ubuntu 18.04?

Is there an equivalent of DynamoDB on Azure as a PHP session Handler

How to Make Laravel Eloquent "IN" Query?

How to make a array inside array?

Accessors (Getter) & Mutators (Setter) On a Pivot Table in Laravel

What is my SQL missing?

PHP: Print caught exception like Xdebug

shell errors running php exec

PHP 8.1: strftime() is deprecated

How to use a PHP MVC Controller, one thats invoked by calling a URL, to call and execute more than one function? [duplicate]

About Contact Privacy policy Terms and conditions