Fix for Fix for in_array problem

  1. function security_list_term_voc($vid) {
  2.         $items = array();
  3.         $terms = taxonomy_get_tree($vid);
  4.         foreach ( $terms as $term ) {  
  5.             $items[] = $term->name;
  6.         }
  7.          return $items;
  8. }
  9.  
  10. The function is used here:
  11. <?php $titlearray = security_list_term_voc(3); ?>
  12. <?php if($node->type == 'page' || $node->type == 'webform' || $node->type == 'resource' || in_array($title,$titlearray,true)): ?>
  13.  
  14. I get the following error:
  15.  
  16. warning: in_array() [function.in-array]: Wrong datatype for second argument in page.tpl.php on line 104.

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.