他の配列(サブ配列)を含む配列があります。キーの特定の値で構成される部分配列のインデックスを取得する必要があります。例えば。これが私の配列です:
Array
(
[0] => Array
(
[id] => 353
[name] => account_2
[ips] =>
[tech_prefix] =>
[password] =>
[id_voip_hosts] =>
[proxy_mode] =>
[auth_type] => ani
[ani] => 526466
[accname] =>
[protocol] =>
[port] =>
[orig_enabled] => 1
[term_enabled] =>
[orig_capacity] =>
[term_capacity] =>
[orig_rate_table] =>
[term_rate_table] =>
[id_dr_plans] =>
[orig_groups] =>
[term_groups] =>
[notes] =>
)
[1] => Array
(
[id] => 352
[name] => account_3
[ips] =>
[tech_prefix] =>
[password] =>
[id_voip_hosts] =>
[proxy_mode] =>
[auth_type] => ani
[ani] => 1345436
[accname] =>
[protocol] =>
[port] =>
[orig_enabled] => 1
[term_enabled] =>
[orig_capacity] =>
[term_capacity] =>
[orig_rate_table] =>
[term_rate_table] =>
[id_dr_plans] =>
[orig_groups] =>
[term_groups] =>
[notes] =>
)
[2] => Array
(
[id] => 354
[name] => account_4
[ips] =>
[tech_prefix] =>
[password] =>
[id_voip_hosts] =>
[proxy_mode] =>
[auth_type] => ani
[ani] => 472367427
[accname] =>
[protocol] =>
[port] =>
[orig_enabled] => 1
[term_enabled] =>
[orig_capacity] =>
[term_capacity] =>
[orig_rate_table] =>
[term_rate_table] =>
[id_dr_plans] =>
[orig_groups] =>
[term_groups] =>
[notes] =>
)
)
私が必要なもの。たとえば、配列サブ配列 [2] から削除する必要があります。unset($myarray[2]) を使用する方法は知っていますが、このインデックスを取得するにはどうすればよいですか [2]。[ani] キー値 472367427 しか知らない場合。var でこの "[2]" を取得して unset コマンドに挿入する方法。= 1345436 であるキー [ani] を持つサブアレイを削除する必要がある場合 (配列 [1] にあります)。キーの値で配列のインデックスを検索する方法はありますか。繰り返しますが、多次元配列の [ani] キーでこのインデックス [2] または [1] を見つける方法は? ありがとう!