• 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 create a cookie to store the timestamp of when a page is first loaded with php

How can i hide dt if dd got empty value

How do I loop through an MS SQL database with VB.NET?

Symfony run hint kernel.secret parameter not found

Malformed MIME header error in Symfony 5.3

How to make a foreign key not using primary key

Two buttons one form

Manage independently the decimal number of the price of each product [duplicate]

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

Make certain characters of a word from string bold

Unsure why I am getting: Number of variables doesn't match number of parameters in prepared statement

Make Calculator - When Button clicked the No shows in Textbox.

Correctly determine if date string is a valid date in that format

Class AppHttpControllersUserController Does Not Exist

Parsing JSON File to array in PHP

About Contact Privacy policy Terms and conditions