can someone explain this code to me ?  $current HERE; function move_left(&$left,&$right,&$current) { array_push($right,$current); $current = array_pop($left); }; function move_right(&$left,&$right,&$current) { array_push($left,$current); $current = array_pop($right); }; function toggle(&$left,&$right,&$current) { $current = 1 - $current; }; ?>

EBK JAVA PROGRAMMING
8th Edition
ISBN:9781305480537
Author:FARRELL
Publisher:FARRELL
Chapter16: Graphics
Section: Chapter Questions
Problem 12RQ
icon
Related questions
Question

can someone explain this code to me ? 

<form>
<?php
$left = array();
$right = array();
$current = 0;
session_start();
extract($_SESSION);
extract($_REQUEST);
if ($button == "Left") move_left();
if ($button == "Right") move_right();
if ($button == "Toggle") toggle();
$_SESSION["left"] = $left;
$_SESSION["right"] = $right;
$_SESSION["current"] = $current;
echo <<<HERE
<input type="submit" name="Left">
<input type="submit" name="Right">
<input type="submit" name="Toggle">
$current
HERE;
function move_left(&$left,&$right,&$current) {
array_push($right,$current);
$current = array_pop($left);
};
function move_right(&$left,&$right,&$current) {
array_push($left,$current);
$current = array_pop($right);
};
function toggle(&$left,&$right,&$current) {
$current = 1 - $current;
};
?>
</form>

Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Concept of Threads
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT