function........
Posted: Fri Nov 19, 2004 8:24 am
heres what i have
i get a parse error and i dont know whats wrong
maybe you cant set a function var to another var and if this is the case does anyone konw a way around it
or another way of doing what im trying to do,
its gonna be a little tic tac toe game, i use a multi-demensional array and all i want to do is set each value in the array to a value that my or maynot have been set yet, i know that the way i have it now everytime i run it it will reset all those session vars to "" but ill fix that when i come to it
thanks in advance
Code: Select all
<?php
session_start();
$_SESSION['1'] = "";
$_SESSION['2'] = "";
$_SESSION['3'] = "";
$_SESSION['4'] = "";
$_SESSION['5'] = "";
$_SESSION['6'] = "";
$_SESSION['7'] = "";
$_SESSION['8'] = "";
$_SESSION['9'] = "";
function buildarray($one = $_SESSION['1'],$two = $_SESSION['2'],$three = $_SESSION['3'],$four = $_SESSION['4'],$five = $_SESSION['5'],$six = $_SESSION['6'],$seven = $_SESSION['7'],$eight = $_SESSION['8'],$nine = $_SESSION['9']) {
$board = array(array($one,$two,$three),array($four,$five,$six),array($seven,$eight,$nine));
return $board;
}
?>Code: Select all
Parse error: parse error, unexpected T_VARIABLE in c:\program files\apache group\apache\htdocs\tictactoe.php on line 13or another way of doing what im trying to do,
its gonna be a little tic tac toe game, i use a multi-demensional array and all i want to do is set each value in the array to a value that my or maynot have been set yet, i know that the way i have it now everytime i run it it will reset all those session vars to "" but ill fix that when i come to it
thanks in advance