in_array usage?
Posted: Mon Jun 19, 2006 9:55 am
OK so i am trying to do the following: I am having an issue with the inarray. I want to say if $col = computername and is not in $excluded array do this.
I am getting a parse error on the in_array if line. Any ideas?
I am getting a parse error on the in_array if line. Any ideas?
Code: Select all
foreach ($row as $col=>$val){
if ($col =="ComputerName" and != in_array("$val", $excluded))
{
if ($col =="ComputerName")
{
$sitecode = server2site("$val");
$output .= " <td class=gray>$sitecode</td><td class =gray> $val</td>\n";
}
else
{
$output .= " <td class =gray>$val</td>\n";
}
}
} // end foreach