Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
184 views
in Technique[技术] by (71.8m points)

php - 加上具有重复列名的数组成员(plus the array member with the repetitious column name)

i want to create a shop site by laravel and now i creating the cart page.

(我想通过laravel创建一个商店站点,现在我创建了购物车页面。)

i saving all product that user want to shop them in array.

(我保存所有用户想要在阵列中购物的产品。)

like this:

(像这样:)


                $array = [
                    [
                      'product' => 'ICDL',
                      'price' => 30,
                      'quantity' => 1
                    ],
                    [
                      'product' => 'ICDL',
                      'price' => 30,
                      'quantity' => 1
                    ],
                    [
                      'product' => 'ICDL',
                      'price' => 30,
                      'quantity' => 1
                    ],
                    [
                      'product' => '3DMAX',
                      'price' => 1030,
                      'quantity' => 1
                    ],
                    [
                      'product' => 'autocat',
                      'price' => 33,
                      'quantity' => 1
                    ],
                    [
                      'product' => 'autocat',
                      'price' => 33,
                      'quantity' => 1
                    ]
                  ];

and i want to showing this in cart page like this

(我想这样显示在购物车页面上)


<h2>ICDL</h2>
<h3>quantity</h3>
<p>3</p>
<h3>price</h3>
<p>90</p>

<hr>
<hr>



<h2>3DMAX</h2>
<h3>quantity</h3>
<p>1</p>
<h3>price</h3>
<p>1030</p>

<hr>
<hr>


<h2>autocat</h2>
<h3>quantity</h3>
<p>2</p>
<h3>price</h3>
<p>66</p>


you should to know i am using laravel.

(您应该知道我正在使用laravel。)

if you can coding for laravel but if you cant doing for laravel, just conding for php.

(如果您可以为laravel编写代码,但如果您不能为laravel编写代码,则只需为php编写代码即可。)

i think i can to convert for laravel.

(我想我可以转换为laravel。)

  ask by arya tehran translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...