• 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

I want to store data in new index as per my key in php [duplicate]

How do I refresh a DIV content?

Laravel with App Engine Standard Class 'FacadeIgnitionIgnitionServiceProvider' not found

How do I remove this delivery notification from here?

Magento Installation SQLSTATE[HY000] [2002] No such file or directory error

Upload a file Using PHP and JavaScript

Laravel Route issues with Route order in web.php

php curl_exec() Connection refused when retrieving a remote image

How can I pass the list to the component variable in Laravel?

add uri parameter to Route name in laravel

How can I get a div content in php

How to get total pages of PDF with FPDF?

GA4 custom event from server side, can someone tell me how i can do the following code in php?

Laravel MSSQL Server Connection not working

image source not readable

About Contact Privacy policy Terms and conditions