Hi,

I`m using the following code to display the contents of a file.....

<?
$filename = "category/category.inc";
$fd = fopen ($filename, "r");
$contents = fread ($fd, filesize ($filename));
fclose ($fd);
$content = explode (",", $contents);

for ($a=0;$a<count($content);$a++){
printf("<TR><TD><A HREF='showcat.php?Cat=%s'>%s</A></TD></TR>", str_replace(" 
","",strtolower($content[$a])), $content[$a]);
}

?>

It is working fine at the moment but I want to try and be a tad more 
ambitious, say for example the category.inc contains the following:

Paul,Mark,Tom,Ade

My code will display the results like so...

(Obviously with my HTML in there too)
Paul
Mark
Tom
Ade

Firstly is there any way I can sort these in alphabetical order??

More importantly is there any way of formatting them so they display

Paul Mark
Tom Ade 

So they are in two columns in a table rather than one??

Thanks for any help
Ade

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to