• 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

WAMP/Wordpress - cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received

Symfony Error: "An exception has been thrown during the rendering of a template"

How to fix 'Data has already been sent to output, unable to output PDF file' in MPDF

Add rows to Single product Additional information table in WooCommerce 3.6

PHP Include for HTML?

find in set in laravel ? example

Limit of log line written to Apache Errorlog from mod php error_log

Is it possible to re-use an array taken from PHP via JSON in a $.ajax function?

"There is no active transaction" when refreshing database in Laravel 8.0 test

WHERE IN array binding in DB::raw laravel 5.4

Is it possible to change the table name in the migration file-laravel

Google Gmail API - How to login programatically?

Script @php artisan package:discover handling the post-autoload-dump event returned with error code 255

Sync Records With Default Values in Pivot Tables, Call to undefined method syncWithPivotDefaults()

Laravel s3 upload file with metadata using pre-signed url

About Contact Privacy policy Terms and conditions