Hi, I'm trying to step through this array when the "further " button is pressed and it should change the image in the div when I echo it out.
I'm getting the following error
Fatal error: Only variables can be passed by reference in C:\wamp\www\SUN_DRAGON_GAME\gamestart.php on line 224
here is the array
Code:
$currentLocation = array
(
'teardrop_ocean_bg' => array
(
'level_1'=>"<img src='<img src='sundragon_environments/ocean/ocean1_FRAME.jpg'/>'",
'level_2'=>"<img src='<img src='sundragon_environments/ocean/ocean1_FRAME2.jpg'/>'",
'level_3'=>"<img src='<img src='sundragon_environments/ocean/ocean1_FRAME3.jpg'/>'",
'level_4'=>"<img src='<img src='sundragon_environments/ocean/ocean1_FRAME.jpg'/>'",
'level_5'=>"<img src='<img src='sundragon_environments/ocean/ocean1_FRAME.jpg'/>'"
)
);
and here is the code I'm using to try to step through the "teardrop_ocean" array.
Code:
$currentLocation='teardrop_ocean';//declare variables/this is set after we click on image map link for teardrop
$currentLocArray='';
//the following is set after we click on the teardrop ocean link on the image map .
//check if the current location is teardrop ocean, if so, set current loc array to the teardrop ocean bg array.
if($currentLocation=='teardrop_ocean'&& !empty($_POST['further']))
{
$currentLocArray=$currentLocation['teardrop_ocean_bg'];
}
//if in teardrop, and further is pressed, go to next element, which is a new img src background.
if($currentLocArray==$currentLocation['teardrop_ocean_bg']&& !empty($_POST['further']))
{
next($currentLocation['teardrop_ocean_bg']);
}
any help greatly appreciated. Thanks. Derek
Last edited by silverglade; 08-04-2010 at 08:34 AM..
|