• 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 do I call a php file with axios?

could not find driver Debian SQL Server PHP

Required field only if another field has a value, must be empty otherwise

Laravel Unresolvable dependency resolving [Parameter #0 [ <required> $method ]] in class GuzzleHttpPsr7Request

Sum column values from multiple arrays

How can I make this nested location configuration use the correct path to call a php program?

How to Make Laravel Eloquent "IN" Query?

Laravel 8 Multiple Relationships for Factory

Transpose multidimensional array and join values with commas

possible options to create pdf file using html elements to generate invoice in php and codeigniter

wordpress : How to specify the cause "This site can’t be reached"

Adding multiple items to WooCommerce cart at once

How to make a foreign key not using primary key

PHP/HTML: Creating A SubMenu

Query Optimization, changing the queries in the loop into a single processing query

About Contact Privacy policy Terms and conditions