because $team_ids is an array of values, not a string. If you don't understand a function, or why it doesn't work, first look at your code and see if there's something you don't understand. In this case, it seems you didn't understand what explode returns. So you should go to the manual and look up [man]explode[/man] to see what it returns. Now, your checks need to be:
if(in_array('23', $team_ids)){