Welcome Guest, Not a member yet? Register   Sign In
Match 2 arrays to declare selected on checkbox
#4

[eluser]DarkManX[/eluser]
Code:
<?php foreach($checkboxes as $box):?>
<p>
  &lt;input
   type="checkbox"
   value="&lt;?=$box['category_id'];?&gt;"
   &lt;?=(in_array($box['category_id'],$selected_cat_ids))?'checked':'';?&gt;&gt;
  &lt;?=$box['name'];?&gt;
</p>
&lt;?php endforeach;?&gt;

Well, i discovered the forum highlighting doesnt work with alternative php syntax, anyway, thats the way you can solve your problem.


Messages In This Thread
Match 2 arrays to declare selected on checkbox - by El Forum - 08-21-2012, 04:42 AM
Match 2 arrays to declare selected on checkbox - by El Forum - 08-21-2012, 05:19 AM
Match 2 arrays to declare selected on checkbox - by El Forum - 08-21-2012, 05:20 AM
Match 2 arrays to declare selected on checkbox - by El Forum - 08-21-2012, 07:10 AM
Match 2 arrays to declare selected on checkbox - by El Forum - 08-21-2012, 08:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB