This script works, appending the footnote "SE Asian Islands" at the bottom of a table column if that column contains at least one item from the array $IslesEurasia.
I'd like to turn it into a PHP switch, so it can display one or more footnotes, based on several arrays. For example, consider the PHP switch below. If a table column includes the ID for both an Asian island and Madagascar (an African island), then it would display this at the end:PHP Code:$IslesEurasia = join("|",array("jpn", "twn", "phl", "bor", "sum"));
if(preg_match("/$IslesEurasia/i",$row['Geog2']))
$Footnote = "SE Asian Islands";
else
print "<br />";
}
echo $Footnote
*Asian island
* African island
But I'm not sure exactly how to wrwite this switch. Any suggestions? Thanks.
PHP Code:$IslesEurasia = join("|",array("jpn", "twn", "phl", "bor", "sum"));
$IslesAfrica = join("|",array("mad"));
switch (preg_match("/$IslesEurasia/i",$row['Geog2']))
{
case '$IslesEurasia':
$Footnote = "SE Asian Islands";
break;
case '$IslesAfrica':
$Footnote = "African Islands";
break;
default:
break;
}




Bookmarks