• 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

How to read laravel_session cookies saved in cookie memory of browser in client side?

Artisan, creating tables in database

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

Laravel : How to Create Dropdown to Select FOREIGN KEY from Other Table?

Display the WooCommerce product price inside a custom function

Target class controller does not exist - Laravel 8

Docker & Laravel : configure: error: Package requirements (oniguruma) were not met

Toggle between a textbox and a select using PHP

Generate random username based on full name php

Script @php artisan package:discover handling the post-autoload-dump event returned with error code 255

wordpress function breaks wp-admin

Reorder attribute dropdown terms in Woocommerce single variable products

PHP Include for HTML?

Display Link Title Instead of URL in XSL

enable Apache http Authorization header

About Contact Privacy policy Terms and conditions