• 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

Undefined Array Key error when uploading image on php

Open a popup box after receiving result from ajax

Using spatie/media-library, how to rename a collection of uploaded files?

Error Class "LaravelFortifyFeatures" not found

Laravel Factory not calling callback 'afterCreating'

phpunit - mockbuilder - set mock object internal property

how to search for a file with php

How to extract price from given url using Xpath?

MySQL/PHP - Web Based Game -User specific inventory table or 1 giant table? Another option?

Xdebug 3 not showing in phpinfo on m1 Monterey

Symfony redirect if already loggedin from login page

How Can I Do LIMIT 1, 2 In WP_Query

how to insert data into select2 search input after scan using qrcode

Laravel Get Days In Month From Month Number?

500 (Internal Server Error) with Laravel & Docker [duplicate]

About Contact Privacy policy Terms and conditions