Date: 07/27/01
- Next message: Iwan Birrer: "[phplib] IT[X] example"
- Previous message: Peter Bowyer: "Re: [phplib] Template extensions & PHP in templates"
- In reply to: Dima Nemchenko: "Re: [phplib] system"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I have a question about list(). I have two files and
want to write the output to the table together. I do
like this, but connection data not shown, because it
assigns 'Array' string to $line2. Why?
How can I do it??
..<table>...
rewind($file);
rewind($file2);
while( (!feof($file) && data=fscanf($file,
"%s%t%s%t%s%n") ) && ( $data2=fscanf($f2, "%s%t%s%n")
)
{
list($bank,$phone)=$data;
print "<tr><td>$bank</td><td>$phone</td>";
list($line2, $conn)=$data2;
print "<td>$conn</td>";
}
print "</tr>";
..</table>...
I attached the file also! Thanks...
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/
<?php
$file = fopen("/export/home/tahmaz/public_html/modem.txt", "r");
$command = "/export/home/tahmaz/public_html/findmodemusage.sh";
$f2 = fopen("/export/home/tahmaz/public_html/connection.txt", "r+"); //rw
$start=33;
$end=96;
exec($command, $conn); //conn is array
reset($conn); /set to beg of array
for($m = 0; $m < $end-$start+1; $m++ )
{ fwrite($f2, $conn[$m]);
fwrite($f2, "\n" );
each( $conn );
}
rewind($f2);
rewind($file);
if(!$file)
{
echo "Sorry, unable to open the 'modem.txt' file.";
exit;
}
print "<table border='1' align='center'>";
print "<tr><td># in Bank</td><td>Phone#</td><td>Rollover#</td><td>Cisco Line</td><td># of Connection</td></tr>";
while( !feof($file) && $data=fscanf($file, "%s\t%s\t%s\t%s\n") $$ $data2=fscanf($f2, "%s\t%s\n") )
{
list($bank, $phone, $rollover, $line)= $data;
list($line2, $connection) = $data2;
print "<tr><td>$bank</td><td>$phone</td><td>$rollover</td><td>$line</td><td>&connection</td></tr>";
}
print "</table>";
?>
-- Abbestellen mit Mail an: phplib-unsubscribe <email protected> Kommandoliste mit Mail an: phplib-help <email protected>
- Next message: Iwan Birrer: "[phplib] IT[X] example"
- Previous message: Peter Bowyer: "Re: [phplib] Template extensions & PHP in templates"
- In reply to: Dima Nemchenko: "Re: [phplib] system"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

