• 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

PHP returning an error message and false

Wordpress how to get the post thumbnail inside a figure tag

Send POST data via raw JSON with Postman

How to send image,audio or video through the WhatsApp API - PHP

Star and Half Star Rating in Laravel

Whats the point of running Laravel with the command 'php artisan serve'?

correct PHP headers for pdf file download

Laravel Nova Dependency Container what are the allowed resource properties other than id in dependsOn

How to properly set "0000-00-00 00:00:00" as a DateTime in PHP

Wordpress wpdb->delete issue

Laravel whole batch is cancelled if one Job fails

Undefined variable in Laravel 8 project (php 7.4)

Multiply each value in array using array_map function

ldap is missing from system when installing adldap2 in laravel

SQLSTATE[HY000]: General error: 1 table posts has no column named *

About Contact Privacy policy Terms and conditions