Hackerss.com

Hackerss.com is a community of amazing hackers

Hackerss is a community for developers, data scientitst, ethical hackers, hardware enthusiasts or any person that want to learn / share their knowledge of any aspect of digital technology.

Create account Log in
hackerss
hackerss

Posted on

Php Check if a string is a valid email address


function isValidEmail($email) {
    return filter_var($email, FILTER_VALIDATE_EMAIL);
}

/* 
PHP
Check if a string is a valid URL
*/

function isValidURL($url) {
    return filter_var($url, FILTER_VALIDATE_URL);
}

/* 
PHP
Check if a string is a valid IP address
*/

function isValidIP($ip) {
    return filter_var($ip, FILTER_VALIDATE_IP);
}

/* 
PHP
Check if a string is a valid IPv4 address
*/

function isValidIPv4($ip) {
    return filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);
}

/* 
PHP
Check if a string is a valid IPv6 address
*/

function isValidIPv6($ip) {
    return filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);
}

/* 
PHP
Check if a string is a valid MAC address
*/

function isValidMAC($mac) {
    return filter_var($mac, FILTER_VALIDATE_MAC);
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCC($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC);
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCType($cc, $type) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => $type)));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeVisa($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'visa')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeMastercard($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'mastercard')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeDiscover($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'discover')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeAmex($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'amex')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeDiners($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'diners')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeJcb($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'jcb')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeEnroute($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'enroute')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeSolo($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'solo')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeSwitch($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'switch')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeDankort($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'dankort')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeInstapayment($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'instapayment')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeLaser($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'laser')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeMaestro($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'maestro')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeElectron($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'electron')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeDelta($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'delta')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeVisaElectron($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'visa-electron')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeUatp($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'uatp')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeCarteBlanche($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'carte-blanche')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeCarteBleue($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'carte-bleue')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeEnc($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'enc')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeCirrus($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'cirrus')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeSwitchMaestro($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'switch-maestro')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeSoloMaestro($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'solo-maestro')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeMaestroInternational($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'maestro-international')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeMaestroUK($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'maestro-uk')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeMaestroUS($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'maestro-us')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeMaestroDomestic($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'maestro-domestic')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeMaestroInternational($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'maestro-international')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeMaestroUK($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'maestro-uk')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeMaestroUS($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'maestro-us')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeMaestroDomestic($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'maestro-domestic')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeMaestroInternational($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'maestro-international')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeMaestroUK($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'maestro-uk')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeMaestroUS($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'maestro-us')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeMaestroDomestic($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'maestro-domestic')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeMaestroInternational($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'maestro-international')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeMaestroUK($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'maestro-uk')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeMaestroUS($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'maestro-us')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeMaestroDomestic($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'maestro-domestic')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeMaestroInternational($cc) {
    return filter_var($cc, FILTER_VALIDATE_CC, array('options' => array('type' => 'maestro-international')));
}

/* 
PHP
Check if a string is a valid credit card number
*/

function isValidCCTypeMaestroUK($cc) {

Enter fullscreen mode Exit fullscreen mode

Latest comments (0)