开发者

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 :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜