title: in_array() expects parameter 2 to be array
body: <p>I have this idea of an multiarray with my files sorted into different groups/arrays.
  Thinking it would be the easiest and most clean way to check what file we're inside, and should the navigation state be set to active on navigation tab 1,2 or 3?</p>
  
  <p>I have this array;</p>
  
  <pre><code>Array
  (
  [home] =&gt; Array
      (
          [0] =&gt; index.php
          [1] =&gt; something.php
      )
  
  [tour] =&gt; Array
      (
          [0] =&gt; tour.php
      )
  
  [tutorials] =&gt; Array
      (
          [0] =&gt; tutorials.php
      )
  )
  </code></pre>
  
  <p>The idea is, if i click on the home navigation button it goes to the index.php and a function checks whether it's the Home button that needs the active state, or the Tour button. In this case its the Home button.</p>
  
  <pre><code>[home] =&gt; Array
      (
          [0] =&gt; index.php
  </code></pre>
  
  <p>I made this function</p>
  
  <pre><code>function findNavigationActive($tap, $filename) {
      if(in_array($filename, $topNavigationPages[$tap])) {
      return 1;
  }
  return 0;
  }
  </code></pre>
  
  <p>it should check, if index.php ($filename) is in the Home ($tap) array or navi-tap, then return 1. Unfortunately i get this error insted;</p>
  
  <blockquote>
    <p>Warning: in_array() expects parameter 2 to be array, null given in /project/../../topNavigationHandler.php on line 21</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>
  
  <p><strong>FIXED</strong></p>
  
  <p>Used global $topNavigationPages; outside the function, and set $topNavigationPages values (array) beneath, and again used global $topNavigationPages inside the function to pull the array inside.
  Thanks @tombs !</p>