You could replace lines 11/12 with
$localtime = $moduleField[2] ? FormatTime($moduleField[2]) : "n/a";and also put your printout data into a variable and only print once per loop iteration instead of every time you want to add output. But I have a hunch that those changes will hardly matter and the real timewaster in this loop is the FormatTime subroutine (which you haven't shown us). I suggest using DevelDProf to find out what your code spends most of its time doing.
In reply to Re: Foreach Loop Optimization
by tirwhan
in thread Foreach Loop Optimization
by upallnight
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |