Home > Backend Development > PHP Tutorial > 求个php数组验证问题,在线等

求个php数组验证问题,在线等

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:17:58
Original
1144 people have browsed it

现在有这么一个数组,是属性表
Array
(

<code>[0] => Array
    (
        [list_attr_id] => 30
        [list_attr_name] => 颜色
        [list_attr_attr] => 黑色|白色|金色
        [list_attr_price] => 0|10.1|20
        [list_attr_shop_id] => 28
    )

[1] => Array
    (
        [list_attr_id] => 31
        [list_attr_name] => 规格
        [list_attr_attr] => 16GB|64GB|128GB
        [list_attr_price] => 0|30|40.22
        [list_attr_shop_id] => 28
    )

[2] => Array
    (
        [list_attr_id] => 32
        [list_attr_name] => 型号
        [list_attr_attr] => 2G|3G|4G
        [list_attr_price] => 1|2|3
        [list_attr_shop_id] => 28
    )
</code>
Copy after login
Copy after login

)

用户选中了一下属性,每个属性对应当前数组的值,请问我怎么验证他的值和数据库一模一样,谢谢
$data =Array
(

<code>[shop_id] => 28
[attr_ids] => Array
    (
        [0] => 30
        [1] => 31
        [2] => 32
    )

[attr_prices] => Array
    (
        [0] => 10.1
        [1] => 0
        [2] => 1
    )

[attr_names] => Array
    (
        [0] => 白色
        [1] => 16GB
        [2] => 2G
    )
</code>
Copy after login
Copy after login

)

回复内容:

现在有这么一个数组,是属性表
Array
(

<code>[0] => Array
    (
        [list_attr_id] => 30
        [list_attr_name] => 颜色
        [list_attr_attr] => 黑色|白色|金色
        [list_attr_price] => 0|10.1|20
        [list_attr_shop_id] => 28
    )

[1] => Array
    (
        [list_attr_id] => 31
        [list_attr_name] => 规格
        [list_attr_attr] => 16GB|64GB|128GB
        [list_attr_price] => 0|30|40.22
        [list_attr_shop_id] => 28
    )

[2] => Array
    (
        [list_attr_id] => 32
        [list_attr_name] => 型号
        [list_attr_attr] => 2G|3G|4G
        [list_attr_price] => 1|2|3
        [list_attr_shop_id] => 28
    )
</code>
Copy after login
Copy after login

)

用户选中了一下属性,每个属性对应当前数组的值,请问我怎么验证他的值和数据库一模一样,谢谢
$data =Array
(

<code>[shop_id] => 28
[attr_ids] => Array
    (
        [0] => 30
        [1] => 31
        [2] => 32
    )

[attr_prices] => Array
    (
        [0] => 10.1
        [1] => 0
        [2] => 1
    )

[attr_names] => Array
    (
        [0] => 白色
        [1] => 16GB
        [2] => 2G
    )
</code>
Copy after login
Copy after login

)

已解决`

Related labels:
php
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template