Jump to content

Recommended Posts

Ive been working on a bunch of different scripts hopefully to make my own dnsstuff.com like tools site I used this same idea for my back end to a script that moves files from my production server to a off site FTP server i have as backups and it worked fine my other script connects to a ftp server lists the contents then disconnects was all fine and dandy but the output looked like crap all smushed together in multiple arrays so i did

 

$contents = ftp_nlist($conn_id, "$dir");

foreach($contents as $a) {
         echo "$a <br />";

 

That works great it neatened it all up and i used the <br> to list all the files directories etc on a different line

 

For my MX /DNS lookup script its the same idea

 

-Original Code to get the ugly multiple arrays

$result = dns_get_record("$host", DNS_ALL);
print_r($result);

 

My idea to list them all on separate lines

$result = dns_get_record("$host", DNS_ALL);
//print_r($result);


      foreach($result as $a) {
      }
foreach($a as $b) {
         echo "$b <br />";
      }

 

It just prints a bunch of lines saying Array the line Array is how i want it to be formated but it doesn't show the information

 

If any one could help point me in the right direction id really appreciate it =) if you need to see my whole code just let me know ill post it.

Link to comment
https://forums.phpfreaks.com/topic/73806-solved-mx-dns-record-lookup-script/
Share on other sites

I came up with a new attempt

 

$result = dns_get_record("$host", DNS_ALL);
//print_r($result);

print_r("<hr>");
for($result_list=0; $result_list < count($result); $result_list++){
$current_line = $result[$result_list];
print "Host: $current_line[host], IP: $current_line[ip], Class: $current_line[class], TTL: $current_line[ttl] And so on...<br>\n";
}

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.