Read one line from the text file at a time.
Then use explode to separate it by semicolons.

Haven't ever done it from a text file myself, but something SIMILAR to this 
should work:

<table border="1" cellpadding="3" cellspacing="0">
<?php
$source_file = file('\\path\\to\\file\\filename.dat');
foreach($source_file as $current_line) {
   list($str1, $url1, $int1, $str2) = explode(';', $current_line);
   print "  <tr>\n";
   print "    <td><a href="$url1">$str1</a></td>\n";
   print "    <td>$int1</td>\n";
   print "    <td>$str2</td>\n";
   print "  </tr>\n";
}
?>
</table>


At 03:45 PM 5/21/01 +0200, you wrote:
>Alain Menard wrote:
>
> > I clicked on the send button to fast...
> >
> > The part that i'm having problem with is the second part. Especially 
> the one
> > about the first string becomming a link to the corresponding URL.
> >
> > ""Alain Menard"" <[EMAIL PROTECTED]> wrote in message
> > 9dv3k5$873$[EMAIL PROTECTED]">news:9dv3k5$873$[EMAIL PROTECTED]...
> > > Hi!!
> > >
> > > I'm presently working on my personal web site and i would like to use PHP
> > to
> > > do the following :
> > >
> > > 1- Read a string in the following format from a text file :
> > >      string;url;integer;string
> > >      string;url;integer;string
> > >      string;url;integer;string
> > >                 ...
> > >      string;url;integer;string
> > >
> > >
> > > 2- Generate a page containing the resulting list in the following 
> format :
> > >
> > >               string      integer     string
> > >               string      integer     string
> > >               string      integer     string
> > >                                ...
> > >               string      integer     string
> > >
> > >       where the first string is a link to the corresponding url.
> > >
> > > Any help would be welcome at this point.
> > > Thank you in advance...
> > >
> > > Alain Menard
>
>As i am a newbie myself - i cannot sypply you with the complete code example.
>I suggest that you look at some example code on how to parse a textfile.
>
>You get your STRING linked you use it in a html HREF tag as follows:
>
><?
>$url="http://www.altavista.com";;
>$msg="Altavista search";
>?>
><a href="<? echo $url; ?>"> <? echo $msg; ?> </a>
>
>
>The example above may not be the best solution, but i have tried it on my
>installation and it works.
>
>--
>
>Michel Laine
>
>CAUTION! In order to eliminate spam i have included 'NOSPAM' in my return
>address.
>To relpy directly to me please remove the NOSPAM in order for the reply to
>propagate correctly.
>
>
>--
>PHP Windows 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]


               -=- Mike Flynn - Burlington, VT -=-
[EMAIL PROTECTED]  http://www.mikeflynn.net/  * Give blood *
  Wouldn't the free market, in its true form, be anarchy?


-- 
PHP Windows 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