Quote:
Originally Posted by Markul
Yea what I really wanted (and I see now that I was a bit unclear) is to take something like:
title, description, url
and turn that into
<li><a href="url" relation="the same for all" title="description">title</a></li>
And imagine I have a big ass list of urls I wanted to do this with. It's ok though, I'll ring up a mate and have him write me an application that'll do that.
|
something like this maybe?
Code:
<?
// title,description,url
$fcontents = file('links.txt');
while (list ($line_num, $line) = each ($fcontents)) {
$c[$count] = $line;
$count++;
}
shuffle($c);
for($i = 0; $i < $count; $i++) {
$ln = explode (',', $c[$i]);
$title = $ln[0];
$desc = $ln[1];
$url = trim($ln[2]);
echo '<li><a href="'.$url.'" title="'.$title.'" rel="external">'.$desc.'</a></li>';
}
?>
exmaple of links.txt
Code:
google,search engine,http://www.google.com
yahoo,shitty search engine,http://www.yahoo.com
bing,lame attempt at google,http://www.bing.com
