我有一个像这样的字符串:
我尝试了"explode"选项,但我得到的数组长这样:
但我需要将它作为一个数组,如下所示:
string
。food_item => 'Butter Croissant',food_id => '1',quantity => '1',price => '140'
我尝试了"explode"选项,但我得到的数组长这样:
Array
(
[0] => 'food_item' => 'Butter Croissant'
[1] => 'food_id' => '1'
[2] => 'quantity' => '1'
[3] => 'price' => '140'
)
但我需要将它作为一个数组,如下所示:
Array
(
[food_item] => 'Butter Croissant'
[food_id] => '1'
[quantity] => '1'
[price] => '140'
)
我该如何做这个?有人可以帮帮我吗?
提前感谢您的帮助。
,
会怎么样? - Salman A