title: Filter array with variable and keep results
body: <p>I have and array:</p>
  
  <pre><code>Array(
    [9533]=&gt;44
    [6478]=&gt;56
  )
  </code></pre>
  
  <p>I want to filter the array with a variable. I have tried this:</p>
  
  <pre><code>function filterArray($value){
      return ($value == $myVar);
  }
  
  $filteredArray = array_filter($myArray, 'filterArray');
  print_r($filteredArray);
  </code></pre>
  
  <p>it just prints:</p>
  
  <pre><code>array()
  </code></pre>
  
  <p>if I change the variable to a hard number like 44, then it will give me what I want.</p>
  
  <pre><code>Array(
    [9533]=&gt;44
  )
  </code></pre>