public static function verifySignature($message, $signature, $signatureKey, $algorithm = 'MD5')
    {
        if (isset($signature)) {
            if ($algorithm === 'MD5') {
                $hash = md5($message . $signatureKey);
            } else if (in_array($algorithm, array('SHA', 'SHA1', 'SHA-1'))) {
                $hash = sha1($message . $signatureKey);
            } else {
                $hash = hash('sha256', $message . $signatureKey);
            }

            if (strcmp($signature, $hash) == 0) {
                return true;
            }
        }

        return false;
    }
public static function verifySignature($message, $signature, $signatureKey, $algorithm = 'MD5')
    {
        if (isset($signature)) {
            if ($algorithm === 'MD5') {
                $hash = md5($message . $signatureKey);
            } else if (in_array($algorithm, array('SHA', 'SHA1', 'SHA-1'))) {
                $hash = sha1($message . $signatureKey);
            } else {
                $hash = hash('sha256', $message . $signatureKey);
            }

            if (strcmp($signature, $hash) == 0) {
                return true;
            }
        }

        return false;
    }
public static function verifySignature ( $ message , $ signature , $ signatureKey , $ algorithm = 'MD5' ) { if ( isset ( $ signature ) ) { if ( $ algorithm === 'MD5' ) { $ hash = md5 ( $ message . $ signatureKey ) ; } else if ( in_array ( $ algorithm , array ( 'SHA' , 'SHA1' , 'SHA-1' ) ) ) { $ hash = sha1 ( $ message . $ signatureKey ) ; } else { $ hash = hash ( 'sha256' , $ message . $ signatureKey ) ; } if ( strcmp ( $ signature , $ hash ) == 0 ) { return true ; } } return false ; }
Function returns signature validate

@param string $message
@param string $signature
@param string $signatureKey
@param string $algorithm

@return bool
Function returns signature validate