General Community > Scripting Help

more input in the Post form question

<< < (4/4)

Anguz:
aaah... I see...

is it possible to add all the values of the array in a single line, instead of a line for each value?

۞:
Yes, you can use it like this:


$MyArray  = array(1 => 'Value 1', 'Value 2', 'Value 3');


go here for more info:

http://www.php.net/manual/en/function.array.php

Anguz:
so I could do it like this:


--- Code: ---$month_list = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');
for ($i = 0; $i <= 11; $i++) {
    echo '<option value="' . $month_list[$i] . '">' . $month_list[$i] . '</option>\n\r';
}
--- End code ---

right? :)

thank you very much for your help ;)

۞:
I *think* that should work, I forget how arrays work in php, I've gotten too used to delphi :P Try it and see.

Navigation

[0] Message Index

[*] Previous page

Go to full version