• 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

PHP usort() order in case of equality

how to loop through json response data using ajax jquery?

Center point of multiple gps coordinates with php

Populate Dynamic Dropdowns List in Codeigniter

PHP Get value from JSON [duplicate]

Get lat/lon from google maps url ftid (hex)

Laravel s3 upload file with metadata using pre-signed url

Cut an arabic string

woocommerce_wp_select options array from product attribute terms

How do I do HTTP basic authentication using Guzzle?

php script to delete files older than 24 hrs, deletes all files

Is there an equivalent of DynamoDB on Azure as a PHP session Handler

Fatal error: [] operator not supported for strings

Woocommerce Checkout - Add conditional field required if one field is filled

SQL to convert multiple rows into a single row of variable length

About Contact Privacy policy Terms and conditions