PHP Looping....need some advice

Posted by Homer_J on Stack Overflow See other posts from Stack Overflow or by Homer_J
Published on 2010-04-30T10:51:10Z Indexed on 2010/04/30 10:57 UTC
Read the original article Hit count: 244

Filed under:

Hi all,

I have the following code:

$q1 = $_POST["q1"];
$q2 = $_POST["q2"];
$q3 = $_POST["q3"];
$q4 = $_POST["q4"];
$q5 = $_POST["q5"];
$q6 = $_POST["q6"];
$q7 = $_POST["q7"];
$q8 = $_POST["q8"];

At the moment, this is hard coded and I need to manually change it each time, I'd like to use variables instead so that it's not a manual process.

Is it a case of using a loop, while or foreach?

If I had the the information $q and q in an array would that help?

Thanks,

Homer.

© Stack Overflow or respective owner

Related posts about php