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 // read the left, right, and maximum values, with default values of 1, 1, and 10 r..

Decoded Output download

<?php 
	// read the left, right, and maximum values, with default values of 1, 1, and 10 respectively. 
	$left = $_SESSION["left"] ?? 1; 
	$right = $_SESSION["right"] ?? 1; 
	$maximum = $_SESSION["maximum"] ?? 10; 
	$product = $left * $right; 
 
	// send back the current times table 
	print("{\"sum\": \"$left x $right\", \"product\": $product}"); 
 
	// add 1 to the right number 
	$right += 1; 
 
	// make sure we increment the left number when right 
	// reaches the maximum, and reset both when the left 
	// reaches the maximum. 
	if ($right > $maximum) { 
		$left += 1; 
		$right = 1; 
 
		if ($left > $maximum) { 
			$left = 1; 
		} 
	} 
 
	// save the current left and right numbers 
	$_SESSION["left"] = $left; 
	$_SESSION["right"] = $right; 
 
	// for debugging purposes we need to allow the 
	// maximum to be changed using a query string. 
	if (isset($_GET["maximum"])) { 
		$_SESSION["maximum"] = (int)$_GET["maximum"]; 
	} 
?>

Did this file decode correctly?

Original Code

<?php
	// read the left, right, and maximum values, with default values of 1, 1, and 10 respectively.
	$left = $_SESSION["left"] ?? 1;
	$right = $_SESSION["right"] ?? 1;
	$maximum = $_SESSION["maximum"] ?? 10;
	$product = $left * $right;

	// send back the current times table
	print("{\"sum\": \"$left x $right\", \"product\": $product}");

	// add 1 to the right number
	$right += 1;

	// make sure we increment the left number when right
	// reaches the maximum, and reset both when the left
	// reaches the maximum.
	if ($right > $maximum) {
		$left += 1;
		$right = 1;

		if ($left > $maximum) {
			$left = 1;
		}
	}

	// save the current left and right numbers
	$_SESSION["left"] = $left;
	$_SESSION["right"] = $right;

	// for debugging purposes we need to allow the
	// maximum to be changed using a query string.
	if (isset($_GET["maximum"])) {
		$_SESSION["maximum"] = (int)$_GET["maximum"];
	}
?>

Function Calls

None

Variables

None

Stats

MD5 ff9657900b1dc43f71466796e55c6ced
Eval Count 0
Decode Time 44 ms