• 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

WAMP/Wordpress - cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received

How to get the survey List from surveygizmo API in the Postman?(Trial Version)

PHP mail function is sending blank message body

Can I use a WooCommerce function without any WooCommerce page?

PHP array_filter with arguments

How to update array value in Laravel

How to use React Router with Laravel?

Download & Save Zoom Recording in directory by PHP

HTML and PHP in one file

How can I get a div content in php

If you intend you use SMTP, add your SMTP Code after this Line

Return new collection without modifying original collection

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

Laravel-fopen: failed to open stream: Permission denied

In PHP, which is faster: preg_split or explode?

About Contact Privacy policy Terms and conditions