I have this db
id | domain | whois_server |
---------------------------------------
1 | ac | whois.nic.ac |
2 | ae | whois.nic.ae |
3 | id | whois.pandi.or.id |
How to show array form array without id ?
array (
'ac' => 'whois.nic.ac',
'ae' => 'whois.nic.ae',
'id' => 'whois.pandi.or.id',
)
I have done the following code:
$sql = "SELECT * FROM whois_server ";
$result = $db->prepare($sql);
$result->execute();
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
$whoisservers = array_merge($whoisservers, array_map('trim', explode(",", $row[1])));
}
but what appears is :
array (
[0] => whois.nic.ac
[1] => whois.nic.ae
[2] => whois.pandi.or.id
)