title: Codeigniter if in_array
body: <p>I'm passing data from my controller to view, I have code in my view</p>
  
  <pre><code>foreach ($mapData as $map)
  {
   echo $map['x'].';'.$map['y'].'&lt;br/&gt;';
  }
  </code></pre>
  
  <p>And it prints me something like </p>
  
  <pre><code>5;5
  6;6
  7;7
  </code></pre>
  
  <p>Now, I am passing another data from my database as a two-dimensional array (i guess)
  which looks like something like this</p>
  
  <pre><code>Array
  (
  [0] =&gt; Array
      (
          [x] =&gt; 5
          [y] =&gt; 4
      )
  
  [1] =&gt; Array
      (
          [x] =&gt; 5
          [y] =&gt; 5
      )
  
  )
  </code></pre>
  
  <p>I want to check if any of $map['x'] and $map['y'] exists in that array so I am doing (Don't know any other way because I need to check this in foreach loop) </p>
  
  <pre><code>if (in_array(array($map['x'], $map['y']), $array)) {
  echo 1;
  }
  </code></pre>
  
  <p>But it doesn't work and according to <a href="http://php.net/manual/en/function.in-array.php" rel="nofollow">http://php.net/manual/en/function.in-array.php</a> it should work? What am I doing wrong? </p>