I have the Foreach loop as below and it is working fine. I want to exit from the elseif when a value is found. I tried changing the elseif to a while and promptly ran out of memory. I assume that there is a way to do this but to date I have been unable to find it.
[php]
foreach ($lines as $line)
{
if (preg_match("/^0 @\w+@ \INDI/", $line))
{
$person[] = $line;
$i++;
$storeLines = true;
}
elseif ($storeLines)
{
$recd[$i][] = $line;
}
}
[/php]
What I want is
[php]
if (strpos($line,-3) ==‘FAM’) //end the elseif if this is true
[/php]