Jump to content

using fgets() in while loop twice


matthew9090

Recommended Posts

Try:

<?php
$sites = array_map('trim',file('file.txt')); //read the whole file into an array & trim the newline character from the end of each line
foreach ($sites as $link) {
   echo "<a href='$link'>$link</a><br />";
}
?>

 

Ken

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.