title: Checking values for an array for every $i
body: <p>I have a for-loop</p>
  
  <pre><code>for($i=0;$i&lt;$n;$i++)
  ($n equals 100)
  </code></pre>
  
  <p>and an array containing values.</p>
  
  <pre><code>$BidsEachHour = array(4,8,13,17......96)
  </code></pre>
  
  <p>What I want to do is that for every $i equal to $BidsEachHour is do a specific check.</p>
  
  <p>How can I check if $i equals $BidsEachHour for every value of $BidsEachHour?</p>
  
  <pre><code>for($i=0;$i&lt;$n;$i++) {
      if(in_array($i,$BidsEachHour)) {
          echo "Yeah, found ".$i." in array!";
      } 
  </code></pre>
  
  <p>Doesn't work.</p>
  
  <p>More info:</p>
  
  <pre><code>$BidsEachHour[] = Hourlybids();
  </code></pre>
  
  <p>Function</p>
  
  <pre><code>Function Hourlybids (){
  Global $tagloads;
  $BidsEachHour = array();
  
  for($k=0; $k &lt; 24; $k++){
  $BidsEachHour[$k] = round($k/24*$tagloads);
  }
  //var_dump($BidsEachHour);
  Return $BidsEachHour;
  }
  </code></pre>