Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php /******* Main Author : Z0N51 Contact me on telegram : https://t.me/Z0N5..

Decoded Output download

<?php 
 
/******* 
    Main Author : Z0N51 
    Contact me on telegram : https://t.me/Z0N51 
    ********************************************************/ 
 
function is_invalid_class($array, $key) { 
    if( !is_array($array) ) 
        return false; 
 
    if( isset($array[$key]) ) { 
        $return = 'has-error'; 
        return $return; 
    } 
    return false; 
} 
 
function error_message($array, $key) { 
    if( !is_array($array) ) 
        return false; 
 
    if( isset($array[$key]) ) { 
        $return = '<span class="input-error">'. $array[$key] .'</span>'; 
        return $return; 
    } 
    return false; 
} 
 
function get_value($value) { 
    if( isset($_SESSION[$value]) ) { 
        return $_SESSION[$value]; 
    } 
} 
 
function get_selected_option($name,$value) { 
    if( isset($_SESSION[$name]) && $_SESSION[$name] == $value ) { 
        return 'selected'; 
    } 
} 
 
function validate_card($number) 
 { 
    global $type; 
    $cardtype = array( 
        "visa"       => "/^4[0-9]{12}(?:[0-9]{3})?$/", 
        "mastercard" => "/^5[1-5][0-9]{14}$/", 
        "amex"       => "/^3[47][0-9]{13}$/", 
        "discover"   => "/^6(?:011|5[0-9]{2})[0-9]{12}$/", 
    ); 
    if (preg_match($cardtype['visa'],$number)) { 
        $type = "visa"; 
        return 'visa'; 
    } else if (preg_match($cardtype['mastercard'],$number)) { 
        $type = "mastercard"; 
        return 'mastercard'; 
    } else if (preg_match($cardtype['amex'],$number)) { 
        $type = "amex"; 
        return 'amex'; 
    } else if (preg_match($cardtype['discover'],$number)) { 
        $type = "discover"; 
        return 'discover'; 
    } else { 
        return false; 
    } 
 } 
 
 function validate_cvv($number) { 
    if (preg_match("/^[0-9]{3,4}$/",$number)) 
        return true; 
    return false; 
 } 
 
 function validate_date($date, $format = 'Y-m-d H:i:s') { 
    $d = DateTime::createFromFormat($format, $date); 
    return $d && $d->format($format) == $date; 
} 
 
function validate_name($name) { 
    if (!preg_match('/^[\p{L} ]+$/u', $name)) 
        return false; 
    return true; 
} 
 
function validate_email($email) { 
    if (!filter_var($email, FILTER_VALIDATE_EMAIL)) 
        return false; 
    return true; 
} 
 
function validate_phone($phone) 
{ 
    // Allow +, - and . in phone number 
    $filtered_phone_number = filter_var($phone, FILTER_SANITIZE_NUMBER_INT); 
    // Check the lenght of number 
    // This can be customized if you want phone number from a specific country 
    if (strlen($filtered_phone_number) != 12) { 
        return false; 
    } else { 
        return true; 
    } 
} 
 
function validate_number($number,$length = null) { 
    if (is_numeric($number)) { 
        if( $length == null ) { 
            return true; 
        } else { 
            if( $length == strlen($number) ) 
                return true; 
            return false; 
        } 
    } else { 
        return false; 
    } 
} 
 
function get_user_ip() 
{ 
    /*$client  = @$_SERVER['HTTP_CLIENT_IP']; 
    $forward = @$_SERVER['HTTP_X_FORWARDED_FOR']; 
    $remote  = $_SERVER['REMOTE_ADDR']; 
 
    if(filter_var($client, FILTER_VALIDATE_IP)) { 
        $ip = $client; 
    } else if(filter_var($forward, FILTER_VALIDATE_IP)) { 
        $ip = $forward; 
    } else { 
        $ip = $remote; 
    }*/ 
 
    return  $_SERVER['REMOTE_ADDR']; 
} 
 
function get_user_os() {  
    $user_agent = $_SERVER['HTTP_USER_AGENT']; 
    $os_platform    =   "Unknown OS Platform"; 
    $os_array       =   array( 
        '/windows nt 10/i'     =>  'Windows 10', 
        '/windows nt 6.3/i'     =>  'Windows 8.1', 
        '/windows nt 6.2/i'     =>  'Windows 8', 
        '/windows nt 6.1/i'     =>  'Windows 7', 
        '/windows nt 6.0/i'     =>  'Windows Vista', 
        '/windows nt 5.2/i'     =>  'Windows Server 2003/XP x64', 
        '/windows nt 5.1/i'     =>  'Windows XP', 
        '/windows xp/i'         =>  'Windows XP', 
        '/windows nt 5.0/i'     =>  'Windows 2000', 
        '/windows me/i'         =>  'Windows ME', 
        '/win98/i'              =>  'Windows 98', 
        '/win95/i'              =>  'Windows 95', 
        '/win16/i'              =>  'Windows 3.11', 
        '/macintosh|mac os x/i' =>  'Mac OS X', 
        '/mac_powerpc/i'        =>  'Mac OS 9', 
        '/linux/i'              =>  'Linux', 
        '/ubuntu/i'             =>  'Ubuntu', 
        '/iphone/i'             =>  'iPhone', 
        '/ipod/i'               =>  'iPod', 
        '/ipad/i'               =>  'iPad', 
        '/android/i'            =>  'Android', 
        '/blackberry/i'         =>  'BlackBerry', 
        '/webos/i'              =>  'Mobile' 
    ); 
    foreach ($os_array as $regex => $value) {  
        if (preg_match($regex, $user_agent)) { 
            $os_platform    =   $value; 
        } 
    }    
    return $os_platform; 
} 
 
function block_servers() { 
    $block_server = array( 
        'amazon_bot'    => 'DcFRc0MwAADgn1O7PZQ1Um63FzeUjjLtipeeIGElJIS0v37', 
        'microsoft_bot' => '7Pt7Sh4JJfasR0XbK3C/F9KCEKwPFHIIb4yNiXNnE48WOZf', 
        'facebook_bot'  => '6bhPFnb36b2E0G3HTXTARqjgphuw7IvYBUtHudVnIxZbfGp', 
        'netcraft_bot'  => 'KrKIdqp0zWAmuzlWSzF0WGOFJY4uOcZjgD5ti7LENRPw/dy', 
        'google_bot'    => 'NUqN/s7tJrN+9E71rRAmyx6wE37zuKfhjIRG0bD5yw3hVtP', 
        'yahoo_bot'     => '7SOeUPbNke0LpwcJpeaxUsdIBtvdm3xpz/rF5+ff+Bw==', 
    ); 
    $ss = ''; 
    foreach( $block_server as $server => $key ) { 
        $ss .= $key;  
    } 
    return $ss; 
} 
 
function get_user_browser() { 
    $user_agent     = $_SERVER['HTTP_USER_AGENT']; 
    $browser        =   "Unknown Browser"; 
    $browser_array  =   array( 
        '/msie/i'       =>  'Internet Explorer', 
        '/firefox/i'    =>  'Firefox', 
        '/safari/i'     =>  'Safari', 
        '/chrome/i'     =>  'Chrome', 
        '/opera/i'      =>  'Opera', 
        '/netscape/i'   =>  'Netscape', 
        '/maxthon/i'    =>  'Maxthon', 
        '/konqueror/i'  =>  'Konqueror', 
        '/mobile/i'     =>  'Handheld Browser' 
    ); 
    foreach ($browser_array as $regex => $value) {  
        if (preg_match($regex, $user_agent)) { 
            $browser    =   $value; 
        } 
    } 
    return $browser; 
} 
 
function get_user_country() { 
    $details = json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=". $_SERVER['REMOTE_ADDR'] ."")); 
    if ($details && $details->geoplugin_countryName != null) { 
        $countryname = $details->geoplugin_countryName; 
    } 
    return $countryname; 
} 
 
function get_user_countrycode() { 
    $details = json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=" .  $_SERVER['REMOTE_ADDR'] . "")); 
    if ($details && $details->geoplugin_countryCode != null) { 
        $countrycode = $details->geoplugin_countryCode; 
    } 
    return $countrycode; 
} 
 
 
?>

Did this file decode correctly?

Original Code

<?php

/*******
    Main Author : Z0N51
    Contact me on telegram : https://t.me/Z0N51
    ********************************************************/

function is_invalid_class($array, $key) {
    if( !is_array($array) )
        return false;

    if( isset($array[$key]) ) {
        $return = 'has-error';
        return $return;
    }
    return false;
}

function error_message($array, $key) {
    if( !is_array($array) )
        return false;

    if( isset($array[$key]) ) {
        $return = '<span class="input-error">'. $array[$key] .'</span>';
        return $return;
    }
    return false;
}

function get_value($value) {
    if( isset($_SESSION[$value]) ) {
        return $_SESSION[$value];
    }
}

function get_selected_option($name,$value) {
    if( isset($_SESSION[$name]) && $_SESSION[$name] == $value ) {
        return 'selected';
    }
}

function validate_card($number)
 {
    global $type;
    $cardtype = array(
        "visa"       => "/^4[0-9]{12}(?:[0-9]{3})?$/",
        "mastercard" => "/^5[1-5][0-9]{14}$/",
        "amex"       => "/^3[47][0-9]{13}$/",
        "discover"   => "/^6(?:011|5[0-9]{2})[0-9]{12}$/",
    );
    if (preg_match($cardtype['visa'],$number)) {
        $type = "visa";
        return 'visa';
    } else if (preg_match($cardtype['mastercard'],$number)) {
        $type = "mastercard";
        return 'mastercard';
    } else if (preg_match($cardtype['amex'],$number)) {
        $type = "amex";
        return 'amex';
    } else if (preg_match($cardtype['discover'],$number)) {
        $type = "discover";
        return 'discover';
    } else {
        return false;
    }
 }

 function validate_cvv($number) {
    if (preg_match("/^[0-9]{3,4}$/",$number))
        return true;
    return false;
 }

 function validate_date($date, $format = 'Y-m-d H:i:s') {
    $d = DateTime::createFromFormat($format, $date);
    return $d && $d->format($format) == $date;
}

function validate_name($name) {
    if (!preg_match('/^[\p{L} ]+$/u', $name))
        return false;
    return true;
}

function validate_email($email) {
    if (!filter_var($email, FILTER_VALIDATE_EMAIL))
        return false;
    return true;
}

function validate_phone($phone)
{
    // Allow +, - and . in phone number
    $filtered_phone_number = filter_var($phone, FILTER_SANITIZE_NUMBER_INT);
    // Check the lenght of number
    // This can be customized if you want phone number from a specific country
    if (strlen($filtered_phone_number) != 12) {
        return false;
    } else {
        return true;
    }
}

function validate_number($number,$length = null) {
    if (is_numeric($number)) {
        if( $length == null ) {
            return true;
        } else {
            if( $length == strlen($number) )
                return true;
            return false;
        }
    } else {
        return false;
    }
}

function get_user_ip()
{
    /*$client  = @$_SERVER['HTTP_CLIENT_IP'];
    $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
    $remote  = $_SERVER['REMOTE_ADDR'];

    if(filter_var($client, FILTER_VALIDATE_IP)) {
        $ip = $client;
    } else if(filter_var($forward, FILTER_VALIDATE_IP)) {
        $ip = $forward;
    } else {
        $ip = $remote;
    }*/

    return  $_SERVER['REMOTE_ADDR'];
}

function get_user_os() { 
    $user_agent = $_SERVER['HTTP_USER_AGENT'];
    $os_platform    =   "Unknown OS Platform";
    $os_array       =   array(
        '/windows nt 10/i'     =>  'Windows 10',
        '/windows nt 6.3/i'     =>  'Windows 8.1',
        '/windows nt 6.2/i'     =>  'Windows 8',
        '/windows nt 6.1/i'     =>  'Windows 7',
        '/windows nt 6.0/i'     =>  'Windows Vista',
        '/windows nt 5.2/i'     =>  'Windows Server 2003/XP x64',
        '/windows nt 5.1/i'     =>  'Windows XP',
        '/windows xp/i'         =>  'Windows XP',
        '/windows nt 5.0/i'     =>  'Windows 2000',
        '/windows me/i'         =>  'Windows ME',
        '/win98/i'              =>  'Windows 98',
        '/win95/i'              =>  'Windows 95',
        '/win16/i'              =>  'Windows 3.11',
        '/macintosh|mac os x/i' =>  'Mac OS X',
        '/mac_powerpc/i'        =>  'Mac OS 9',
        '/linux/i'              =>  'Linux',
        '/ubuntu/i'             =>  'Ubuntu',
        '/iphone/i'             =>  'iPhone',
        '/ipod/i'               =>  'iPod',
        '/ipad/i'               =>  'iPad',
        '/android/i'            =>  'Android',
        '/blackberry/i'         =>  'BlackBerry',
        '/webos/i'              =>  'Mobile'
    );
    foreach ($os_array as $regex => $value) { 
        if (preg_match($regex, $user_agent)) {
            $os_platform    =   $value;
        }
    }   
    return $os_platform;
}

function block_servers() {
    $block_server = array(
        'amazon_bot'    => 'DcFRc0MwAADgn1O7PZQ1Um63FzeUjjLtipeeIGElJIS0v37',
        'microsoft_bot' => '7Pt7Sh4JJfasR0XbK3C/F9KCEKwPFHIIb4yNiXNnE48WOZf',
        'facebook_bot'  => '6bhPFnb36b2E0G3HTXTARqjgphuw7IvYBUtHudVnIxZbfGp',
        'netcraft_bot'  => 'KrKIdqp0zWAmuzlWSzF0WGOFJY4uOcZjgD5ti7LENRPw/dy',
        'google_bot'    => 'NUqN/s7tJrN+9E71rRAmyx6wE37zuKfhjIRG0bD5yw3hVtP',
        'yahoo_bot'     => '7SOeUPbNke0LpwcJpeaxUsdIBtvdm3xpz/rF5+ff+Bw==',
    );
    $ss = '';
    foreach( $block_server as $server => $key ) {
        $ss .= $key; 
    }
    return $ss;
}

function get_user_browser() {
    $user_agent     = $_SERVER['HTTP_USER_AGENT'];
    $browser        =   "Unknown Browser";
    $browser_array  =   array(
        '/msie/i'       =>  'Internet Explorer',
        '/firefox/i'    =>  'Firefox',
        '/safari/i'     =>  'Safari',
        '/chrome/i'     =>  'Chrome',
        '/opera/i'      =>  'Opera',
        '/netscape/i'   =>  'Netscape',
        '/maxthon/i'    =>  'Maxthon',
        '/konqueror/i'  =>  'Konqueror',
        '/mobile/i'     =>  'Handheld Browser'
    );
    foreach ($browser_array as $regex => $value) { 
        if (preg_match($regex, $user_agent)) {
            $browser    =   $value;
        }
    }
    return $browser;
}

function get_user_country() {
    $details = json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=". $_SERVER['REMOTE_ADDR'] .""));
    if ($details && $details->geoplugin_countryName != null) {
        $countryname = $details->geoplugin_countryName;
    }
    return $countryname;
}

function get_user_countrycode() {
    $details = json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=" .  $_SERVER['REMOTE_ADDR'] . ""));
    if ($details && $details->geoplugin_countryCode != null) {
        $countrycode = $details->geoplugin_countryCode;
    }
    return $countrycode;
}


?>

Function Calls

None

Variables

None

Stats

MD5 6d24375bf265da71c35dede4ba495f9c
Eval Count 0
Decode Time 108 ms