I have problem with selecting elements from array i have this code which is supposed to take the choosed element and echo it back but instead that this code just takes last element and echo it what is wrong with the code ?
<div class="col-xs-3">
<?php
global $m;
$currencies = array("GBP"=>"£", "EUR"=>"€", "USD"=>"$");
?>
<form action="" method="POST">
<div class="input-group stylish-input-group">
<p><input type="text" class="form-control" placeholder="Bet" name="bet" style="display: inline;" required/></p>
<span class="input-group-addon">
<button type="button">
<span class="glyphicon glyphicon-menu-down" tabindex="0" title="Choose Currency" role="button" data-toggle="popover" data-trigger="focus" data-placement="bottom" data-content="
<?php
foreach($currencies as $m => $value) {
?>
<p><a href='#' type='submit' data-toggle='modal' data-target='#currencyModal'><?= $m; ?></a></p>
<?php
}
?>"/><?php echo $m ?></span>
</button>
</span>
</div>
</form>
</div>
<div class="modal fade" id="currencyModal" tabindex="0" data-trigger="focus" role="dialog" aria-labelledby="myModalLabell">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Set Default Currency</h4>
</div>
<div class="modal-body">
<p>Do you want to make <?php echo $m; ?> your default currency ?</p>
<br>
<p style="font-size: small; color: #90949c;">By setting it by default you will be no longer asked to choose default currency. Also tickets you add automatically will be in the currency you choose as default.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" >YES</button>
<button type="button" class="btn btn-danger" data-dismiss="modal">NO</button>
</div>
</div>
</div>
</div>