Hi all!
I have a file (file01, i.e) like this:
foo
foo
foo
bar
foo
bar
foo
....
Where foo and bar repeats n times, but only foo and bar. What i want to
print is just:
foo
bar
I have tried this:
$myfile=file("file01");
$current_line = reset($myfile);
$first_line = $current_line;
print("First line is: $first_line");
while ($current_line=next($myfile))
{
if ($current_line != $first_line)
{
print("The other line is: $current_line");
break;
}
}
and it works as stand alone, but in the real application, i get:
Fatal error: Cannot break/continue 1 level in
/var/www/html/web/include/functionShow.inc on line 172
Does anyone knows how to do it in another way?
Thanks a lot.