Good day to you all,
Here I come again with a piece of code which reach a txt file and return the text, it also convert the “n” into “<br>”.
Here it is :
[code=php]function drawList($list)
{
$thelist = ”;
foreach($list as $file=>$string)
{
$lines = nl2br($string);
$thelist .= ‘<b class=”b1h”></b><b class=”b2h”></b><b class=”b3h”></b><b class=”b4h”></b>’;
$thelist .= ‘<div class=”headh”>’;
$thelist .= ‘<b>’.$file.'</b>’;
$thelist .= ‘</div>’;
$thelist .= ‘<div class=”contenth”><div class=”text”>’;
$thelist .= $lines.'<br/>’;
$thelist .= ‘</div>’;
$thelist .= ‘</div>’;
$thelist .= ‘<b class=”b4bh”></b><b class=”b3bh”></b><b class=”b2bh”></b><b class=”b1h”></b><br/>’;
}
return $thelist;
}
How can I make $lines have alternate row color ?
Thanks !