For Loop Statement

Posted by acctman on Stack Overflow See other posts from Stack Overflow or by acctman
Published on 2010-04-23T00:47:22Z Indexed on 2010/04/23 0:53 UTC
Read the original article Hit count: 347

Filed under:

I'm trying to loop 2 variables and with an output that looks like this '91 - 96 lbs' I can get the For statement to work with just one variable but with two it does not work.

for ($k = 91; $k <= 496; $k=$k+4($i = 96; $i <= 500; $i=$i+4))  
echo '<option value='.$k. ' - ' .$i. ' lbs'("<%m_weight%>" == .$k. ' - ' .$i. ' lbs' ? ' selected="selected"' : '').'>'.$k. ' - ' .$i. ' lbs</option>'; 

© Stack Overflow or respective owner

Related posts about php