title: PHP warning: in_array() wrong datatype for second argument in
body: <p>I recently got this error on my error log:</p>
  
  <pre><code>   PHP Warning:  in_array() [&lt;a href='function.in-array'&gt;function.in-array&lt;/a&gt;]: Wrong datatype for second argument in... on line 423
  </code></pre>
  
  <p>and refers to the following piece of code:</p>
  
  <pre><code>    &lt;?php foreach($services_a as $key=&gt;$service) { ?&gt;
      &lt;div class="oneservice"&gt;
      &lt;input type="checkbox" name="services[]" value="&lt;?php echo $key; ?&gt;" id="service&lt;?php echo $key; ?&gt;"&lt;?php if( in_array($key, $services) ) { echo ' checked="checked"'; } ?&gt; /&gt;
      &lt;label for="service&lt;?php echo $key; ?&gt;"&gt;&lt;?php echo $service; ?&gt;&lt;/label&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>Any views are very welcome,
  Thanks</p>