• 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

WHERE IN array binding in DB::raw laravel 5.4

google content api for shopping

Toggle between a textbox and a select using PHP

Laravel 5 session not persisting after user is logged in

Laravel query builder binding parameters more than once

Elasticsearch - Want to sort by field in all indices where that particular field available or not if not then avoid it

Add bold text and line break into Laravel Notification Email

Laravel - Browser displays message again when I press back button

Move a child array to parent array and change parent/child name

how to identify the web server name of remote host

How to get transaction details in notify_url page in paypal

"cannot list resources" error from WooCommerce REST API

How to increase the PHP upload limits [duplicate]

Laravel-fopen: failed to open stream: Permission denied

I can't delete my image when it is liked because of the foreign key in mysql

About Contact Privacy policy Terms and conditions