I have a php object containing two arrays and I need to loop through both array at once and display option for select. The table->list should come inside the value and tables->title should come inside option HTML output.
Here is my code:
$tables = new \stdClass();
$tables->list = ['bmg_contact_us','bmg_volunteer'];
$tables->title = ['Contact us', 'Volunteer'];
<select name="bmg-forms" onchange="submission_frm.submit();">
<?php
foreach ($tables as $key => $table) {
echo "<option value='" . $tables->list . "'>'" . $tables->title . "'</option>";
}
?>
</select>