how can i store this array into a session and use sessions to move the elements inside the array up/down/left/right diagonally
$board = array(A B C D E F G H
You store it in a session like
<?php
session_start();
$board=array('whatever');
$session['board']=$board;
As for manipulation, it is just a normal array. You can work with it like any other array.
Call session_start and afterwards store your variables in $_SESSION -- they will be available throughout the session:
session_start();
$_SESSION['board'] = array( ... );
Moving elements is just a matter of assigning one value to another, for example:
$_SESSION['board'][$new_i][$new_j] = $_SESSION['board'][$old_i][$old_j];
$_SESSION['board'][$old_i][$old_j] = ...;
$_SESSION['myArray'] = $board;
and you can access any element using $_SESSION['myArray'][i][j];
Yes. you can store and update an array in session. use like this :
session_start();
$_SESSION['youarray'] =$board;
and now do updates in $_SESSION['youarray'] array according to your requirement that will be like normal array. but stored in session.