I have class that stores data about network packet:
var $from_ip;
var $to_ip;
var $from_port;
var $to_port;
var $tcp_length;
var $tcp_stream_text;
var $tcp_stream;
var $tcp_sequence_dec;
And now, I am creating function to print it:
function Print_data()
{
echo "<table>";
echo "<tr><td>";
echo "From IP:";
echo "</td><td>";
echo $this->from_ip;
echo "</td></tr>";
echo "<tr><td>";
echo "To IP:";
echo "</td><td>";
echo $this->to_ip;
echo "</td></tr>";
echo "</table>";
}
Is there any way to omptimize it? As you may notice there will be a lot of same lines. (Exept, may be write a function to show it). But what about vars?