• 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 curl_exec() Connection refused when retrieving a remote image

Object of class stdClass could not be converted to string error

How to edit Records using CodeIgniter

How to send image,audio or video through the WhatsApp API - PHP

How can I convert from a{a{} b{}} to a[a[],b[]] using php preg_match?

Pagekite error: FAIL: localhost:8080 is down

Prestashop webservice API creating cart rules

Display Brand Name Above Product Title in Woocommerce Cart, Checkout Page, Orders and Email Notification

Laravel lang slug in url

Use Python plotly chart in PHP

is there any way to validate a field that sometime is File(image) && sometime is String(Src of same image)

How to install php yaml on CentOs?

GuzzleHttp Hangs When Using Localhost

Debugging Stripe Webhook Event

Apply session id from request header

About Contact Privacy policy Terms and conditions