• 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

MongoDB Duplicate Documents even after adding unique key

Add rows to Single product Additional information table in WooCommerce 3.6

yii2 and mssql insert varbinary into model

Laravel print last executed SQL query with Query log

How do I refresh a DIV content?

Laravel update hasMany relationship using saveMany

How to Display Data in Yajra Datatables Laravel 7?

GuzzleHttp Hangs When Using Localhost

display WooCommerce “Add to cart” button with short-code [add_to_cart ] dynamically

No result using makeStyles Material UI in react 18

Failed user login on production server using Symfony framework (Authentication request could not be processed due to...)

Unable to guess the mime type as no guessers are available Laravel 5.2

CSS file not imported in laravel blade view

Display Brand Name Above Product Title in Woocommerce Cart, Checkout Page, Orders and Email Notification

Display the default discounted price and percentage on Woocommerce products

About Contact Privacy policy Terms and conditions