• 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

How to Display Data in Yajra Datatables Laravel 7?

Google Gmail API - How to login programatically?

Laravel 5 session not persisting after user is logged in

Store multiple fields in JSON column (Nova CMS)

How to get result of the formula on import xlsx with maatwebsite using Laravel? I get formula and not value of the formula

How to run a shell as root from php (apache)

PHP using str_starts_with for array to exclude same as with wildcard

Laravel query builder binding parameters more than once

Add customer email and phone in "Order" column to admin orders list on Woocommerce

How to insert Google Adsense Code in PHP script?

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

OctoberCMS / Anonymous Global Scope

how to use extended ASCII instead of unicode in PHP

How to add class name to an existing tag in php

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

About Contact Privacy policy Terms and conditions