I populate a select box like this
foreach ( $prov->getLicences() as $licence ) {
echo '<option value="' . $licence['id'] . '">' . $licence['licence'] . '</option>';
}
This select box is for editing an existing db entry, so i can grab the already selected licences with this.
$prov->getSubscriberLicences($id)
This will return an array of id's, how do i check these id's against the available values in the select box above.
If they match i want to add the selected
tag to the option value.
echo '<option selected value="' . $licence['id'] . '">' . $licence['licence'] . '</option>';
EDIT:
Please be aware $prov->getSubscriberLicences($id)
returns an array of multiple ids
here is a var dump
array(2) { [0]=> array(1) { ["id"]=> string(1) "1" } [1]=> array(1) { ["id"]=> string(1) "3" } }
looks like its multidementional