PHP, TXT, HTML table nightmare!!!!!!

Hi,

I’m massively new to this. I have a test page here

http://www.justmarriedfilming.co.uk/txttest.php

as you can see from the code below I have a html table which pulls in 3 sepearte .txt files. Am wondering if there is an easier way of doing this, using only 1 txt file and using commas to separate the text into columns??

sorry, i’m new to php!!!

cheers

<table width="90%" border="0" class="black-text-regular"> <tr> <td width="63%">Venue</td> <td width="18%">Time</span></td> <td width="19%">Date</span></td> </tr> <tr> <td class="black-text-regular"> <?php include("venue.txt"); ?> </td> <td class="black-text-regular"> <?php include("time.txt"); ?> </td> <td class="black-text-regular"> ><?php include("date.txt"); ?> </td> </tr> </table>

Hello, :smiley:
couple questions for ya:

how much information is stored in the files?
is it one word or muliple words?
one row or multiple?
will they always be the same format with just the values changing?

Let me know, i’ll put a script together for you.

:wink:

Hi there,

Maybe this sort of setup could help you out?

info.txt:

Leeds|7.30pm|14 February London|8.30pm|13 February York|4.30pm|1 March

php:
[php]$info = file(“info.txt”,FILE_IGNORE_NEW_LINES);
$venues = array();
$times = array();
$dates = array();
foreach($info as $line)
{
$data = explode("|",$line);
$venues[] = $data[0];
$times[] = $data[1];
$dates[] = $data[2];
}
[/php]

html:

[code]

<?php echo implode("
",$venues); ?> <?php echo implode("
",$times); ?> <?php echo implode("
",$dates); ?> [/code]
Sponsor our Newsletter | Privacy Policy | Terms of Service