Cheers all.
I have a class (php5) which uses an array of names. This array is declared at the top of the script outside of the class. In a public static method I check to see if a name being passed in is in the array. I'm getting an error that tells me the second argument to my in_array() must be an array. Apparently the code is not seeing my array.
I'm hoping someone can tell me why. If I move the array to the method, it works, but I thought it should work the first way.
<?php
$team_names = array('John','Bill','Bob','Ted','Jim');
class web_team{
// some class code here //
public static function is_team_member($name){
global $team_names
return in_array($name, $team_names);
}
}
Thanks for any tips!!