• 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

Not able to override collapsible.js in magento 2

Laravel after login Two factor not working

How to create a cookie to store the timestamp of when a page is first loaded with php

Using if(isset($_POST['submit'])) to not display echo when script is open is not working

Wordpress wpdb->delete issue

PHPMetrics option --excluded-dirs="myfolder" : myfolder dir is not excluded within docker

Last order would be re-order in wooCommerce. How is it possible?

Convert string to lowercase AND then convert it to its original form in PHP, is it possible?

Converting alphabet letter to alphabet position in PHP [duplicate]

PHP: How to raise number to (tiny) fractional exponent?

Laravel/docker-compose/redis - Class 'Redis' not found

How to install php yaml on CentOs?

How to map the two arrays with a duplicate value?

PHP Include for HTML?

TesseractOCR not working for Laravel

About Contact Privacy policy Terms and conditions