title: Removing elements from an array whose value matches a specified string
body: <p>I have an array that looks like this:</p>
  
  <pre>
  Array ( [0] => Vice President [1] =>   [2] => other [3] => Treasurer )
  </pre>
  
  <p>and I want delete the value with <code>other</code> in the value.</p>
  
  <p>I try to use <code>array_filter</code> to filter this word, but <code>array_filter</code> will delete all the empty values, too.</p>
  
  <p>I want the result to be like this:</p>
  
  <pre>
  Array ( [0] => Vice President [1] =>   [2] => Treasurer )
  </pre>
  
  <p>This is my PHP filter code:</p>
  
  <pre><code>function filter($element) {
    $bad_words = array('other');  
  
    list($name, $extension) = explode(".", $element);
    if(in_array($name, $bad_words))
      return;
  
    return $element;
  }
  
  $sport_level_new_arr = array_filter($sport_level_name_arr, "filter");
  
  $sport_level_new_arr = array_values($sport_level_new_arr);
  
  $sport_level_name = serialize($sport_level_new_arr);
  </code></pre>
  
  <p>Can I use another method to filter this word?</p>