First Array Output:
print_r($categories);
Array
(
[1] => Accounting & Financial
[2] => Advertising Services
[3] => Awards & Incentives
[4] => Business Consultants
[5] => Career Services
[6] => Creative Services
[7] => Data Management
[8] => Distributors & Agents
)
Second array Output:
print_r($Service_Provider_Id['Category']);
Array
(
[0] => Array
(
[id] => 1
[category] => Accounting & Financial
)
[1] => Array
(
[id] => 2
[category] => Advertising Services
)
)
My Below code showing all checkbox base on first array
<?phpforeach ($categories as $key => $value) { ?>
<div class="checkboxes-div">
<input type="checkbox" id="CategoryCategory<?php echo $key; ?>" value="<?php echo $key?>" name="data[Category][Category][]">
<label class="selected" for="CategoryCategory<?php echo $key; ?>">
<?php echo $value; ?>
</label>
</div>
<?php } ?>
if second array category's key value match with first array value so i want to selected checkbox