Any suggestion Please…
I have about ten paragraphs of text that is inside the file is calls output.txt and I want the file named table.php to read this file (output.txt) and justify all the text and output to the screen, but the problem is that all of the text in each paragraph got to be in one long line, otherwise, it won’t work at all. You can use these text lines to test.
To make it clear that all of the above text in each paragraph got to be in one line, in order to make it work (justify the text).
Thanks very much.
——–This is called [table.php]————
<HTML>
<HEAD>
<TITLE></TITLE>
<STYLE>
<!–
.button_rgb0001_0001
{
BORDER-RIGHT: #000000 1px solid;
PADDING-RIGHT: 10px;
BORDER-TOP: #4b4d5b 1px solid;
PADDING-LEFT: 1px;
FONT-SIZE: 8pt;
BACKGROUND: #292831;
PADDING-BOTTOM: 1px;
BORDER-LEFT: #4b4d5b 1px solid;
COLOR: #7e7e7e;
PADDING-TOP: 10px;
BORDER-BOTTOM: #000000 1px solid;
FONT-FAMILY: “MS Sans Serif”, Verdana, Helvetica, Arial, sans-serif
}
p.tp-tble10-0002 {FONT-WEIGHT: normal; FONT-SIZE: 10pt; TEXT-ALIGN: justify; COLOR: #aaaaaa; FONT-STYLE: normal; FONT-FAMILY: “Times New Roman”, “MS Sans Serif”, Arial, sans-serif}
//–>
</STYLE>
</HEAD>
<BODY bgcolor=”#293831″>
<table CLASS=button_rgb0001_0001 Align=”CENTER” cellspacing=”10″ style=”border-collapse: collapse” width=”30%”>
<tr>
<td>
<?
// the following statement opens the files called output.txt
// and reads each line of the file into an array called $readfile
// Each line will be accessed by it’s position in the array
// $readfile[0] would be the first line because the array begins at 0
// rather than 1
//———————————————-
$readfile = file(“output.txt”);
// Create a loop that will read all elements of the array and print out
// each field of the tab-delimited text file
for ($k=0; $k<=count($readfile)-1; $k++)
{
$fields = split(“t”,$readfile[$k]);
print(“<font color=”#888888″><p style=”text-align:justify”>$fields[0]</font>”);
}
//———————————————–
$readfile = file(“output.txt”);
print(“<HR>”);
for ($k=0; $k<=count($readfile)-1; $k++)
{
$fields = split(“t”,$readfile[$k]);
print(“<p class=”tp-tble10-0002″>$fields[0]</p>”);
}
$readfile = file(“output.txt”);
print(“<HR>”);
for ($k=0; $k<=count($readfile)-1; $k++)
{
$fields = split(“t”,$readfile[$k]);
print(“<p class=”tp-tble10-0002″>$fields[0]</p>”);
}
</TD>
</TR>