title: how to use in_array for subarrays in php?
body: <p>I need to verify if a value is inside an array, and I'm using the php function <code>in_array()</code> for it. I noticed it doesn't work when the array I send to the <code>in_array()</code> function is composed by subarrays.
  Is there anyway to do this verification for subarrays?
  To help you to understand my problem, I have the following code:</p>
  
  <pre><code>$userIds = array();
  foreach($accounts as $account){
      $accounIds[] = $account-&gt;getId();
      $userIds[] = AccountUserBeanHome::findAllIdsByAccountId($account-&gt;getId());
  }
  $userId = 225;
  if (in_array($userId, $userIds, true)) {
      do action...
  }
  </code></pre>
  
  <p>The problem is that the array $userIds may be something like this:</p>
  
  <pre><code>Array
  (
  [0] =&gt; Array
      (
          [0] =&gt; 225
          [1] =&gt; 226
          [2] =&gt; 227
          [3] =&gt; 228
          [4] =&gt; 229
          [5] =&gt; 230
          [6] =&gt; 340
          [7] =&gt; 355
      )
  
  [1] =&gt; Array
      (
          [0] =&gt; 313
          [1] =&gt; 314
          [2] =&gt; 315
          [3] =&gt; 316
          [4] =&gt; 318
          [5] =&gt; 319
      )
  
  [2] =&gt; Array
      (
          [0] =&gt; 298
          [1] =&gt; 301
          [2] =&gt; 302
          [3] =&gt; 338
      )
  
  )
  </code></pre>
  
  <p>I noticed <code>in_array()</code> doesnt work to check sub-arrays, so I'd like your help to do this verification... maybe a way to make all the subarrays elements become all elements of the main array... well.. I hope u can help me. </p>