Adding values to nested array
Posted: Mon Apr 14, 2008 9:48 am
Hi,
I am trying to add some values to a nested array via a foreach loop.
This is how I am trying to add my values:
However, the following error is thrown:
Fatal error: [] operator not supported for strings in...
I have been able to add values using the above method before but it just doesn't want to work this time.
The value I am adding is definitely a number!
I am trying to add some values to a nested array via a foreach loop.
This is how I am trying to add my values:
Code: Select all
$_SESSION['selectedStageQuestions'][$expKey][$expStage][$expQuestionKey][]=$seqNumber;
Fatal error: [] operator not supported for strings in...
I have been able to add values using the above method before but it just doesn't want to work this time.
The value I am adding is definitely a number!