So, I have a variable which have all the menu_ids. So what I want to show is - Check with the current variable i.e $get_all_menu_values and if the value is there, then mark it tick(checked). Else leave it blank.
<?php
$get_all_menu_values = "1,2,3,4,5"; ?>
<ul>
<?php foreach ($getSubMenuValues as $sub_menu): ?>
<li class='has-sub'><a href='<?=$sub_menu['menu_url']; ?>'><span><?=$sub_menu['menu_name']; ?></span></a></li>
<div align="center"><input type="checkbox" class="form" value="" name="get_menu_values[]" /></div>
<?php endforeach; ?>
</ul>
In other words - check with the $get_all_menu_values and if the m_id is the same make it checked. More or less checking with IN array I guess. But don't know how to do that. Any help.
Thanks, Kimz
$get_all_menu_valuesan array or string?