Reputation: 67
I have a code snippet, which prints the output by obtaining the number of lines from a shell script using for loop.
I want to skip the second line and print the remaining lines.
$lines = explode("\n", $output);
for ($i = 1; $i <sizeof($lines); $i++)
{
echo '<tr>';
$columns = explode("\t", $lines[$i]);
}
Should I not be using for loop?
Upvotes: 0
Views: 124
Reputation: 3579
you need to check the number of line and make use of continue in php
for ($i = 1; $i <sizeof($lines); $i++)
{
if($i==2){ continue; }
echo '<tr>';
$columns = explode("\t", $lines[$i]);
}
Upvotes: 1