我想從海量數組中獲得一些值,並且出現了一些問題。 我有這樣數組:從assoiavite海量數組中選擇值
array(2) {
[0]=>
array(23) {
["ITEM_ID"]=>
int(2331)
["ITEM_TYPE_ID"]=>
string(1) "1"
["CART_ITEM_ID"]=>
string(0) ""
["SAVED_TYPE_ID"]=>
string(0) ""
["ITEM_NAME"]=>
string(17) "TEST STOCK LEVELS"
["ERROR"]=>
string(0) ""
["PROPERTIES"]=>
array(1) {
[522]=>
array(1) {
[0]=>
string(4) "1122"
}
}
["PROPERTIES_INFO"]=>
array(1) {
[522]=>
array(12) {
["USAGE_TYPE"]=>
string(1) "1"
["CONTROL"]=>
string(7) "LISTBOX"
["TYPE"]=>
string(1) "1"
["NAME"]=>
string(11) "TEST OPTION"
["VALUES"]=>
array(1) {
[0]=>
string(4) "1122"
}
["REQUIRED"]=>
string(1) "1"
["PARENT_PROPERTY_ID"]=>
string(0) ""
["PARENT_VALUE_ID"]=>
string(0) ""
["TEXT"]=>
array(0) {
}
["CONTROL_PRICE"]=>
int(0)
["ORDER"]=>
string(1) "1"
["QUANTITY_ACTION"]=>
string(1) "1"
}
}
["PROPERTIES_PRICE"]=>
float(10)
["PROPERTIES_PERCENTAGE"]=>
int(0)
["PROPERTIES_BUYING"]=>
int(0)
["PROPERTIES_DISCOUNT"]=>
int(0)
["PROPERTIES_MORE"]=>
string(1) "0"
["COMPONENTS"]=>
array(0) {
}
["QUANTITY"]=>
int(11)
["TAX_FREE"]=>
string(1) "0"
["DISCOUNT"]=>
int(1)
["BUYING_PRICE"]=>
string(0) ""
["PRICE_EDIT"]=>
string(1) "0"
["PRICE"]=>
string(5) "10.00"
["CHECK_PRICE"]=>
float(20)
["MAX_ITEM_DISCOUNT"]=>
float(20)
["CART_PRICE"]=>
float(20)
}
[1]=>
array(23) {
["ITEM_ID"]=>
int(2331)
["ITEM_TYPE_ID"]=>
string(1) "1"
["CART_ITEM_ID"]=>
string(0) ""
["SAVED_TYPE_ID"]=>
string(0) ""
["ITEM_NAME"]=>
string(17) "TEST STOCK LEVELS"
["ERROR"]=>
string(0) ""
["PROPERTIES"]=>
array(1) {
[522]=>
array(1) {
[0]=>
string(4) "1123"
}
}
["PROPERTIES_INFO"]=>
array(1) {
[522]=>
array(12) {
["USAGE_TYPE"]=>
string(1) "1"
["CONTROL"]=>
string(7) "LISTBOX"
["TYPE"]=>
string(1) "1"
["NAME"]=>
string(11) "TEST OPTION"
["VALUES"]=>
array(1) {
[0]=>
string(4) "1123"
}
["REQUIRED"]=>
string(1) "1"
["PARENT_PROPERTY_ID"]=>
string(0) ""
["PARENT_VALUE_ID"]=>
string(0) ""
["TEXT"]=>
array(0) {
}
["CONTROL_PRICE"]=>
int(0)
["ORDER"]=>
string(1) "1"
["QUANTITY_ACTION"]=>
string(1) "1"
}
}
["PROPERTIES_PRICE"]=>
float(20)
["PROPERTIES_PERCENTAGE"]=>
int(0)
["PROPERTIES_BUYING"]=>
int(0)
["PROPERTIES_DISCOUNT"]=>
int(0)
["PROPERTIES_MORE"]=>
string(1) "0"
["COMPONENTS"]=>
array(0) {
}
["QUANTITY"]=>
int(5)
["TAX_FREE"]=>
string(1) "0"
["DISCOUNT"]=>
int(1)
["BUYING_PRICE"]=>
string(0) ""
["PRICE_EDIT"]=>
string(1) "0"
["PRICE"]=>
string(5) "10.00"
["CHECK_PRICE"]=>
float(30)
["MAX_ITEM_DISCOUNT"]=>
float(30)
["CART_PRICE"]=>
float(30)
}
}
之前循環該陣列中,我接收一些PROPERTY_ID(1123例如)。 我需要檢查,如果這PROPERTY_ID(在我的情況下,1122)這個元素相匹配
["PROPERTIES"]=>
array(1) {
[522]=>
array(1) {
[0]=>
string(4) "1122"
}
}
然後選擇它的數量屬性(在我的情況下,這個元素)
["QUANTITY"]=>
int(11)
的問題是確定從哪個數組中選擇這個屬性,因爲首先我需要將我收到的值與數組中的現有值進行比較(在我的例子中爲1122)。
'str_replace函數($ thisPost, '海量', '陣')'...? Babelfish平臺? – deceze
對不起))現在,編輯 – volodymyr3131
我沒有得到它,你可以進一步指定你的問題 – worenga