我想看看用 PHP 数组创建 where 语句的最佳方法
$array = array (
0 => array (
'host' => 'aol.com',
'type' => 'A',
'ip' => '64.12.89.186',
'class' => 'IN',
'ttl' => '2466'
),
1 => array (
'host' => 'aol.com',
'type' => 'A',
'ip' => '205.188.100.58',
'class' => 'IN',
'ttl' => '2466'
),
2 => array (
'host' => 'aol.com',
'type' => 'A',
'ip' => '205.188.101.58',
'class' => 'IN',
'ttl' => '2466'
),
3 => array (
'host' => 'aol.com',
'type' => 'A',
'ip' => '207.200.74.38',
'class' => 'IN',
'ttl' => '2466'
),
4 => array (
'host' => 'aol.com',
'type' => 'A',
'ip' => '64.12.79.57',
'class' => 'IN',
'ttl' => '2466'
),
5 => array (
'host' => 'aol.com',
'type' => 'NS',
'target' => 'dns-01.ns.aol.com',
'class' => 'IN',
'ttl' => '2466'
),
'6' => 'array (',
'host' => 'aol.com',
'type' => 'NS',
'target' => 'dns-07.ns.aol.com',
'class' => 'IN',
'ttl' => '2466'
),
7 => array (
'host' => 'aol.com',
'type' => 'NS',
'target' => 'dns-06.ns.aol.com',
'class' => 'IN',
'ttl' => '2466'
),
8 => array (
'host' => 'aol.com',
'type' => 'NS',
'target' => 'dns-02.ns.aol.com',
'class' => 'IN',
'ttl' => '2466'
),
9 => array (
'host' => 'aol.com',
'type' => 'SOA',
'mname' => 'dtc-ext3.edns.aol.com',
'rname' => 'hostmaster.aol.net',
'serial' => '352455322',
'refresh' => '43200',
'retry' => '180',
'expire' => '2592000',
'minimum-ttl' => '300',
'class' => 'IN',
'ttl' => '1691'
),
10 => array (
'host' => 'aol.com',
'type' => 'MX',
'pri' => '15',
'target' => 'mailin-04.mx.aol.com',
'class' => 'IN',
'ttl' => '2466'
),
11 => array (
'host' => 'aol.com',
'type' => 'MX',
'pri' => '15',
'target' => 'mailin-01.mx.aol.com',
'class' => 'IN',
'ttl' => '2466'
),
12 => array (
'host' => 'aol.com',
'type' => 'MX',
'pri' => '15',
'target' => 'mailin-02.mx.aol.com',
'class' => 'IN',
'ttl' => '2466'
),
13 => array (
'host' => 'aol.com',
'type' => 'MX',
'pri' => '15',
'target' => 'mailin-03.mx.aol.com',
'class' => 'IN',
'ttl' => '2466'
),
14 => array (
'host' => 'aol.com',
'type' => 'TXT',
'txt' => 'v=spf1 ptr:mx.aol.com ?all',
'class' => 'IN',
'ttl' => '2465'
),
15 => array (
'host' => 'aol.com',
'type' => 'TXT',
'txt' => 'spf2.0/pra ptr:mx.aol.com ?all',
'class' => 'IN',
'ttl' => '2465'
)
);
这是我的数组,我想在 EX type = NS 上创建一个 where 语句,依此类推,然后将所有内容传递给要显示的变量。
请注意,如果我不回复评论/问题,我将在接下来的几个小时内关闭我的互联网进行维修。