Page 1 of 1

Arrays

Posted: Tue May 12, 2009 10:15 pm
by misfitxnet
I am trying to manipulate an array from a output text file.
It is from a form, and so far it outputs onto only one line.

Here is the code im using

Code: Select all

 
<?php
             
               $commenttext=file_get_contents("d:\hshome\c239198\local54memberforum.com\info.txt");
               list($name, $comment) = split("\t", $commenttext);
               while (list($name, comment) = split("\t", $commenttext);
        echo "<tr>". 
            "<td>$name</td>\n"."</tr>\n"."<tr>"."<td>$comment</td>\n"."</tr>\n";
 
 
               
?>
 
This will only make the first two elements into an array, $name and $comment, but ignores the rest.
Is there anyway to make new lines in the output, or include the rest of the output and not only the first two elements?

Re: Arrays

Posted: Tue May 12, 2009 10:50 pm
by Griven
I don't know about formatting your output, but I did notice "comment" is a literal rather than a variable in your LIST construct.