开发者

How to create a multidimensional array in PHP?

开发者 https://www.devze.com 2023-04-05 02:39 出处:网络
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.

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

精彩评论

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

关注公众号