Note that there are some explanatory texts on larger screens.

plurals
  1. POprint count before the loop?
    primarykey
    data
    text
    <pre><code>&lt;div class="biz_gary_btn fl width81 mt10"&gt; &lt;div class="pl10 pr10" onclick="javascript:catsub();"&gt;Subscribe&lt;/div&gt; &lt;/div&gt; &lt;div class="arial bold fnt12 c2f4792 underline fl pl20 pt5"&gt;&lt;?php echo $count; ?&gt; Feeds&lt;/div&gt;// Here I am going to print my count !!!! but the count will be incremented here &lt;/div&gt; &lt;/div&gt; &lt;div id="arrow_content" class="fl cl pl10 arial bold fnt11 c2f4792 answer width500"&gt; &lt;div class="clearfix pb10"&gt;&lt;!--Subscribe 2nd loop starts here --&gt; &lt;div class="fl"&gt; &lt;div class="fl"&gt;&lt;img src="images/orange_tab.png" /&gt;&lt;/div&gt; &lt;div class="fl pl10 c666"&gt;Feeds on this Bundle&lt;/div&gt; &lt;/div&gt;&lt;?php foreach($cat['sub_category'] as $sub_cat) { //echo ($count); ?&gt; &lt;style&gt; #subscribe_chk&lt;?php echo $sub_cat['id'];?&gt;.checked{ background: url(&lt;?php echo base_url();?&gt;images/pre_checked.jpg) no-repeat; background-position:0px 2px; } &lt;/style&gt; &lt;div class="cl pre_check fl pt10"&gt; &lt;input id="sub_chk&lt;?php echo $sub_cat['id'];?&gt;" value="&lt;?php echo $sub_cat['id'];?&gt;" name="sub_id" onclick="send_value(this.value)" type="checkbox" /&gt; &lt;label id="subscribe_chk&lt;?php echo $sub_cat['id'];?&gt;" for="sub_chk&lt;?php echo $sub_cat['id'];?&gt;" class="pl5" style="background-color:#FFFFFF;" &gt;&lt;?php echo $sub_cat['sub_category'];?&gt;&lt;/label&gt; &lt;/div&gt; &lt;?php $count++; ?&gt;// here I am incrementing the count. How do i print it before the loop &lt;?php } ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload