我有一個返回鍵和值的數組。如何在關聯數組(PHP)上打印或獲取特定值
<?php
print_r(array_values($arResult["DISPLAY_PROPERTIES"]));
$arresults = $arResult["DISPLAY_PROPERTIES"];
?>
上面的代碼會顯示這樣的結果:
Array ([0] => Array
([ID] => 29
[TIMESTAMP_X] => 2014-08-26 08:23:13
[IBLOCK_ID] => 3
[NAME] => ProductID
[ACTIVE] => Y
[SORT ] => 500
[CODE] => product_id
[DEFAULT_VALUE] =>
[PROPERTY_TYPE] => S
[ROW_COUNT] => 1
[COL_COUNT] => 30
[LIST_TYPE] => L
[MULTIPLE] => N
[XML_ID] => [file_type] =>
[MULTIPLE_CNT] => 5
[TMP_ID] =>
[LINK_IBLOCK_ID] => 0
[WITH_DESCRIPTION] => N
[SEARCHABLE] => N
[filtrable] => N
[IS_REQUIRED] => N
[VERSION] = > 1
[user_type] =>
[USER_TYPE_SETTINGS] =>
[HINT] =>
[PROPERTY_VALUE_ID] => 11880
[VALUE] => PCA.CD08.21.A1
[DESCRIPTION] =>
[VALUE_ENUM] =>
[VALUE_XML_ID] =>
[VALUE_SORT] =>
[~ VALUE] => PCA.CD08.21.A1
[~ DESCRIPTION] =>
[~ NAME] => ProductID
[~ DEFAULT_VALUE] =>
[display_value] => PCA.CD08.21.A1)
)
問題:我怎樣才能顯示值PCA.CD08.21.A1。什麼PHP代碼做的我用於僅顯示PCA.CD08.21.A1?
請幫我...
什麼以下普林?的print_r($ arResult [ 'DISPLAY_PROPERTIES']);因爲array_values刪除了密鑰 – 2014-08-28 09:53:35
@vizvi即將做同樣的事情... Redshot,請格式化您的問題,以便易於閱讀,並使人們很容易回答 - 這只是您的興趣。 – Fluffeh 2014-08-28 10:03:21