PDA

View Full Version : how do i use "for loop" in a PHP block ?


soothepain
02-19-2013, 05:45 AM
I can output most of php code in PHP block, but cant do it with any loop like "if"or"for"or"while" ...
why is that?

for example, I enter something very simple like

for($i=0;$j<5;$i++)
{
$output .= "test";
}
it should be "testtesttesttesttest" on the page, but it shows nothing :(

kh99
02-19-2013, 01:38 PM
You have a typo - your 'for' line has $j<5; instead of $i<5;.

soothepain
02-20-2013, 12:16 PM
sorry i just typed it wrong here, it still doesnt work :(
but thanks anyway, i changed it with iframe after all.