• 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

WordPress Security Standards want me to escape my html, but how to do it correctly?

Laravel Mix Uncaught ReferenceError: $ is not defined

Why does using salted hash on python and php give me different results?

How to display table header in every page using FPDF library?

how to identify the web server name of remote host

Insert a DIV after the 6th product only once in WooCommerce category archives

How can I easily switch between PHP versions on Mac OSX?

Limit of log line written to Apache Errorlog from mod php error_log

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

echo language construct is discouraged. (PHP)

how to prevent float variables displaying as scientific notation when printing [duplicate]

Add and update products to session cart in Laravel

javascript html popup window

Laravel implode array items to new lines

PHP Imap , php 7.4.3 on mac osx catalina

About Contact Privacy policy Terms and conditions