Home › Forums › Back End › FOR loop with counter in variables › Re: FOR loop with counter in variables
May 20, 2013 at 7:03 pm
#135780
Alen
Participant
You can also be explicit by using `{}` like so:
for( $i=1; $i<4; $i++ ) {
if( get_field( “product_image_{$i}” ) ) {
echo get_field( “product_image_{$i}” ); } }
This way when you’re reading PHP code, it’s clear what is happening or what is expected to happen.