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!