• 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

Issue with laravel eloquent model property

Find out the name of the last script that included the current one

Json_Encode not returning html even i try to encode JSON_HEX_QUOT | JSON_HEX_TAG

Combine array with same value and add other [duplicate]

Trying to iterate over a mongodb cursor twice - failing

Google Calendar API batch request PHP

Put content of wordpress page inside div

MySQL - Connection failed: No route to host

how to see if database exists with PDO [duplicate]

LARAVEL: How to fetch id dynamically in a query builder?

Laravel no logout option from menu after successfull login

Sum array values of a column within each column of an array with 3 levels

How do I upload a laravel project on cPanel shared hosting?

How to reset Laravel AuthManager/guards in between API calls in tests?

How can I get a div content in php

About Contact Privacy policy Terms and conditions