php - How to express a formula using an array
大家讲道理
大家讲道理 2017-05-16 12:02:07
0
3
410

For example:
Cucumber

The array must be stored in the database, and parameters must be used later to match the calculation results
大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(3)
phpcn_u1582

Is this so?

[
    "items": ["黄瓜" => 10, "萝卜" => 1],
    "total": ["草莓" => 1]
]

When saving to an array, first use json_encode方法转jsonstring

伊谢尔伦
[{
    "cucumber": 10
},{
    "radish": 10
},{
    "berries": 10
}]

or


[{
    "cucumber": 10,
    "radish": 10,
    "berries": 10
}]
Peter_Zhu
// 或者这样?
[
    {
       cucumber: 10,
       radish: 1,
       Strawberry: 1, 
       result: true
    },
    {
       cucumber: 5,
       radish: 1,
       Strawberry: 1, 
       result: false
    }
]
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template