-1

我怎样才能使它只对数据而不是html列进行foreach?

    <div class="columns">
        <div class="title">Donation Amount</div>
        <div class="title">Support</div>
        <div class="title">View Grant</div>

<?php foreach ($results->result() as $grant) : ?>
        <div class="col1"><p>AUD $<?php echo number_format($grant->user_budget);?></p></div>
        <div class="col2"></div>
        <div class="col3"></div>
    </div>
        <div class="clear"></div>
    <?php endforeach ; ?>
4

1 回答 1

0

尝试这个

   <div class="columns">
        <div class="title">Donation Amount</div>
        <div class="title">Support</div>
        <div class="title">View Grant</div>

<?php foreach ($results->result() as $grant) : ?>
        <div class="col1"><p>AUD $<?php echo number_format($grant->user_budget);?></p></div>
        <div class="col2"></div>
        <div class="col3"></div>
        <div class="clear"></div>
  <?php endforeach ; ?>
    </div>
于 2013-05-01T07:05:21.700 回答