I’m getting a parse error:
[QUOTE]
Parse error: parse error, expecting `‘,” or
and I can’t figure out why. It says I’m missing a semicolon, but there is a semicolon there! Here’s the problematic code:
[code=php]
function parseTest($testname) {
$fname = “/brandon/tests/” . $testname . “.txt”;
if (file_exists($fname)) {
global $test = array(); // line 17
global $title = “”;
global $i = 0;
$file = file($fname);
foreach ($file as $line) {
if (substr($line, 0, 1) != ” “) {
$title = $line;
}
elseif (substr($line, 0, 4) == ” ” && substr($line, 4, 1) != ” “) {
$test[substr($line, 4)] = array();
$i++;
}
elseif (substr($line, 0, 8) == ” ” && substr($line, 8, 1) != ” “) {
list($name, $value) = explode(“=”, substr($line, 8));
$test[$i – 1][$name] = substr($line, 8);
}
else {
break;
}
}
}
else {
echo “<h1>Error! Specified test does not exist!</h1>n”;
}
}
I haven’t gotten a parse error in months, so this is really weird. Please help! ?
Oh, here’s a link to the live page:
[url]http://www.radioactiverabbit.com/brandon/tests.php