リピーターを含むフォームによって作成された大きな配列があるため、配列は無限に大きくなる可能性があります。する必要がある:
- 1.配列を検索する
- 2. [field_18] のすべての値を取得する
- 3. すべての値 ('-5'、'-1'、ect ) を含む配列を出力します。
Array
(
[field_22] => Mid-Distance Free
[field_25] => Array
(
[0] => 1
)
[field_23] => Its a freestyle workout
[field_6] => Array
(
[0] => Array
(
[field_7] => 1
[field_8] => 0
[field_9] => 0
[field_10] => Array
(
[0] => Array
(
[field_11] => 6
[field_12] => 50
[field_13] => jumping jacks
[field_14] =>
)
[1] => Array
(
[field_11] => 2
[field_12] => 20
[field_13] => pushups
[field_14] =>
)
[acfcloneindex] => Array
(
[field_11] => 1
[field_12] => 1
[field_13] => pushups
[field_14] =>
)
)
)
[acfcloneindex] => Array
(
[field_7] => 1
[field_8] => 0
[field_9] => 0
[field_10] => Array
(
[acfcloneindex] => Array
(
[field_11] => 1
[field_12] => 1
[field_13] => pushups
[field_14] =>
)
)
)
)
[field_17] => Array
(
[0] => Array
(
[field_7] => 1
[field_8] => 0
[field_9] => 0
[field_10] => Array
(
[0] => Array
(
[field_11] => 5
[field_12] => 100
[field_13] => Freestyle
[field_14] => Descend 1-5
[field_18] => 5
)
[1] => Array
(
[field_11] => 10
[field_12] => 50
[field_13] => Drill
[field_14] => Choice
[field_18] => 5
)
[2] => Array
(
[field_11] => 1
[field_12] => 400
[field_13] => Freestyle
[field_14] => Negative Split
[field_18] => -20
)
[acfcloneindex] => Array
(
[field_11] => 1
[field_12] => 25
[field_13] => Butterfly
[field_14] =>
[field_18] =>
)
)
)
[acfcloneindex] => Array
(
[field_7] => 1
[field_8] => 0
[field_9] => 0
[field_10] => Array
(
[acfcloneindex] => Array
(
[field_11] => 1
[field_12] => 25
[field_13] => Butterfly
[field_14] =>
[field_18] =>
)
)
)
)
[field_19] => Array
(
[0] => Array
(
[field_7] => 1
[field_8] => 0
[field_9] => 1
[field_10] => Array
(
[0] => Array
(
[field_11] => 20
[field_12] => 100
[field_13] => Freestyle
[field_14] => Hold 500 race pace
[field_18] => -5
)
[1361771245813] => Array
(
[field_11] => 1
[field_12] => 75
[field_13] => Butterfly
[field_14] =>
[field_18] =>
)
[acfcloneindex] => Array
(
[field_11] => 1
[field_12] => 125
[field_13] => Butterfly
[field_14] =>
[field_18] =>
)
)
)
[acfcloneindex] => Array
(
[field_7] =>
[field_8] => 0
[field_9] => 0
[field_10] => Array
(
[acfcloneindex] => Array
(
[field_11] => 1
[field_12] => 25
[field_13] => Butterfly
[field_14] =>
[field_18] =>
)
)
)
)
[field_21] => Array
(
[acfcloneindex] => Array
(
[field_7] =>
[field_8] => 0
[field_9] => 0
[field_10] => Array
(
[acfcloneindex] => Array
(
[field_11] =>
[field_12] => 25
[field_13] => Butterfly
[field_14] =>
[field_18] =>
)
)
)
)
)
すべてのキーを調べようとしましたが、そこからどこに行くべきかわかりませんでした。これは私が使用していたコードです。
function array_keys_multi(array $array)
{
$keys = array();
foreach ($array as $key => $value) {
$keys[] = $key;
if (is_array($array[$key])) {
$keys = array_merge($keys, array_keys_multi($array[$key]));
}
}
return $keys;
}