php - How to put a variable name in for loop? -


i got value using this:

        $count = <?php  $details->shop_image_count; ?>    

i want use $count in for loop, not getting value of count

         <?php             for($i=1;$i<($count);$i++){                                     echo '<li data-target="#shopcarousel" data-slide-to="' . $i . '"></li>';                                }          ?> 

you should use this

$count = $details->shop_image_count; 

instead of

$count = <? echo $details->shop_image_count;?>   

Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -