Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
162 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 Answer

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...