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 function UserLine($file, $searchfor, $option){ $contents = file_get_contents($fil..

Decoded Output download

<?php 
function UserLine($file, $searchfor, $option){ 
	$contents = file_get_contents($file); 
	$pattern = preg_quote($searchfor, '/'); 
	$pattern = "/^.*$pattern.*\$/m"; 
	 
	if(preg_match_all($pattern, $contents, $matches)){ 
		$Line = $matches[0][0]; 
		if($option == "Check"){ 
			return true; 
		} 
		elseif($option == "line"){ 
			return $Line; 
		} 
		elseif($option == "pwd"){ 
			$pwd = explode(" ", $Line); 
			return $pwd[2]; 
		} 
		elseif($option == "exp"){ 
			$exp = explode("enddate=", $Line); 
			$exp2 = explode(";", $exp[1]); 
			return strtotime($exp2[0]); 
		} 
	} 
	else{ 
		return false; 
	} 
} 
 
function UpdateFile($file, $searchfor){ 
	$contents = file_get_contents($file); 
	$lines = explode("
", $contents); 
	$exclude = array(); 
	$pattern = '/('.$searchfor.')/im'; 
 
	foreach ($lines as $key => $value) { 
		if (!preg_match($pattern, $value)) { 
			$exclude[] = $value; 
		} 
	} 
	$res = implode("
", $exclude); 
	return file_put_contents($file, $res); 
} 
 
function DisplayError($errMsg){ 
	echo '<div class="row"><div class="input-group input-group-icon referer-warning"> '.$errMsg.'</div></div>'; 
} 
 
function clean($var){ 
	$nvar = trim(htmlspecialchars($var)); 
	$banned_chars = array("ports", "port", "cccam", "mgcamd", "http", "default", "editor", "restart", "yes", "cache", "profiles", "profile" , "enddate", "quot"); 
	return str_ireplace($banned_chars, "", preg_replace("![^a-z0-9]+!i", "", $nvar)); 
} 
?>

Did this file decode correctly?

Original Code

<?php
function UserLine($file, $searchfor, $option){
	$contents = file_get_contents($file);
	$pattern = preg_quote($searchfor, '/');
	$pattern = "/^.*$pattern.*\$/m";
	
	if(preg_match_all($pattern, $contents, $matches)){
		$Line = $matches[0][0];
		if($option == "Check"){
			return true;
		}
		elseif($option == "line"){
			return $Line;
		}
		elseif($option == "pwd"){
			$pwd = explode(" ", $Line);
			return $pwd[2];
		}
		elseif($option == "exp"){
			$exp = explode("enddate=", $Line);
			$exp2 = explode(";", $exp[1]);
			return strtotime($exp2[0]);
		}
	}
	else{
		return false;
	}
}

function UpdateFile($file, $searchfor){
	$contents = file_get_contents($file);
	$lines = explode("\n", $contents);
	$exclude = array();
	$pattern = '/('.$searchfor.')/im';

	foreach ($lines as $key => $value) {
		if (!preg_match($pattern, $value)) {
			$exclude[] = $value;
		}
	}
	$res = implode("\n", $exclude);
	return file_put_contents($file, $res);
}

function DisplayError($errMsg){
	echo '<div class="row"><div class="input-group input-group-icon referer-warning"> '.$errMsg.'</div></div>';
}

function clean($var){
	$nvar = trim(htmlspecialchars($var));
	$banned_chars = array("ports", "port", "cccam", "mgcamd", "http", "default", "editor", "restart", "yes", "cache", "profiles", "profile" , "enddate", "quot");
	return str_ireplace($banned_chars, "", preg_replace("![^a-z0-9]+!i", "", $nvar));
}
?>

Function Calls

None

Variables

None

Stats

MD5 8ccb0da2771d67e6daf6e6e280bccf4a
Eval Count 0
Decode Time 87 ms