<style>
	body { background-color: #eeeeee; }
	border:0
	valign="top"
</style>
<?php
require_once("VatsimPHPgenerator.php");
$VatsimPHP=new VatsimPHP;
$pilotlist=$VatsimPHP->pilots();
$flag=0;
$found = false;
foreach ($p in $pilotlist) {
     $m = substr($p[11],0,4)."|".substr($p[13],0,4);
     if (preg_match("/TTCP|TGPY|TBPB/", $m)) { 
          printf("<tr><th>%s</th><td>%s</td><td>-%s</td></tr>", $p[0], $p[11], $p[13]);
          $found = true;
     }
}
if (!$found) print("<tr><td>There are currently no ongoing flights within the Piarco airspace.</td></tr>");

?>

That is my PHP script. I get the following error:

"Parse error: syntax error, unexpected T_STRING in /home/colst0/public_html/piarco/piarcotest.php on line 12"

I've been cracking away at this for a little over a week, and am lost. Anyone have a suggestion?

i didn't look hard enough the first time.

the foreach statement should be:

foreach ($pilotlist as $p) {

should help. i don't see anything else wrong.

Great. That solved the issue. The only issue is that the script produces something with no spaces, like this:

BWA417KJFK-TBPBN76JRTJSJ-TBPB

when it should be:

BWA417 KJFK-TBPB
N76JR TJSJ-TBPB

This is the HTML output:

<tr><th>BWA417</th><td>KJFK</td><td>-TBPB</td></tr><tr><th>N76JR</th><td>TJSJ</td><td>-TBPB</td></tr>
This article has been dead for over six months. Start a new discussion instead.