Actually your code will still be a little screwy.
If #TGPs = #FS then they will be displayed with both loops. Your >= and <= overlap.
Look at this
PHP Code:
$numfs=count($fslinks);
$numtgp=count($tgplinks);
$maxLoop = $numtgp;
if($numfs > $numtgp) {
$maxLoop = $numfs;
}
for($i=0;$i<$maxLoop;$i++){
if($i <= $numtgp) {
$tgp=explode("|",$tgplinks[$i]);
print("<a href=$tgp[0]>$tgp[4]</a><br>$tgp[2]<br><br>\n");
}
if($i <= $numfs) {
$fs=explode("|",$fslinks[$i]);
print("<a href=$fs[0]>$fs[4]</a><br>$fs[2]<br><br>\n");
}
}