How to create a multidimensional array in PHP?
Please help me to create multidimensional array. I'm using ajax. When new request come, then new array concatenate with previous array. I want concatenate when new request come. Thank a lot.
$_session['calculate'] = array(
"filename" => $filename,
"source" => $source,
"destination" => $destination,
"subjectarea" => $subjectarea开发者_开发问答,
"total_word" => $total_word,
"total_price" => $total_price,
"euro" => 20,
"chf" => 30,
);
Just try with:
$_session['calculations'][] = array(
"filename" => $filename,
...
);
and then again..
$_session['calculations'][] = array(
"filename" => $filename,
...
);
You will get a calculations
array of arrays with your data :)
精彩评论