Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14346

Explode for selected

$
0
0
Hi all,

I have trouble on this code,

In DB "planCurrencies" = "1,2,3,4"
PHP Code:
<select class="select2" name="currency[]" style="width: 100%" multiple="multiple" data-placeholder="Choose">
    <?
php
    $cid 
explode(',',$plan->planCurrencies);
    foreach(
$this->currencies_model->get() as $c) { ?>
    <option value="<?php echo $c->ID?><?php echo $c->ID == $cid "selected":"" ?>><?php echo $c->currencyCode?></option>
    <?php ?>
</select> 

This code already show all currencies but selected currency not working,

Thanks you

Viewing all articles
Browse latest Browse all 14346

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>