Display Format
| From: | Website4S at aol dot com | Date: | Tue, 20 Feb 2001 16:35:56 +0000 |
| Subject: | Display Format | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-40759@lists.php.net to get a copy of this message | ||
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