Re: Re: making an array from data in textfile
| From: | Dave W | Date: | Sun, 23 Jul 2006 14:43:36 +0000 |
| Subject: | Re: Re: making an array from data in textfile | ||
| References: | 1 2 3 4 5 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-42252@lists.php.net to get a copy of this message | ||
Well, its what I want so I could do a foreach array like this and print out
the ips in a table:
foreach($ips as $value) {
$value = trim($value);
$domain = gethostbyaddr($value);
echo " <tr class=\"alternate\">
<th scope=\"row\">3</th>
<td>$value</td>
<td>$domain</td></tr> ";}
echo '
</tbody></table></div>';
It works!
On 7/23/06, Stut <stuttle@gmail.com> wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Dave W wrote: I figured it out before, but I didn't hit reply all. I used files() and newlines to create it. Would using explode be a more reliable way? I assume you mean the file() function, not files(). The only problem with doing it that way is that each element of the array will have a newline on the end. Maybe this is what you want, but I doubt it. - -Stut -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEw3tl2WdB7L+YMm4RAg3xAJ0SPUPR+00PXVIfJhDfg4WrBWVi/ACgsFOu 9usmbLbhNrXUCef+uCyzAY4= =RXbe -----END PGP SIGNATURE------- Dave W