Jump to content

[SOLVED] array


corillo181

Recommended Posts

You could use a for loop.

 

<?php

$array=array(1=>'January','February','March','April','May','June','July','August','September','October','November','December');

//Where you want the array to start
$start = 3;

for($i = $start; $i < count($array); $i++){
?>

<option value="<?=$i ?>"><?=$array[$i] ?></option>

<?
}

?>

 

Though I'm not sure what your doing, so this might not work out for your situation.

Link to comment
https://forums.phpfreaks.com/topic/55878-solved-array/#findComment-276046
Share on other sites

Yeah, PHP requires a submit/page refresh. I'm not positive what your doing, but it sounds like it's a job for javascript. I would help you myself, but I'm not very good with javascript yet. Post in the javascript forum and someone will help you pretty fast, or maybe you can even find something on google?

 

Link to comment
https://forums.phpfreaks.com/topic/55878-solved-array/#findComment-276064
Share on other sites

yeah the thing is i don't really like javascript too much because a lot of people has it off, but i guess i can post a javascript must be on for the page.

 

but my idea is.

 

have 3 list menu

 

[year] [month] [day]

 

but when someone goes in to the page only going to see year list

 

[year]

 

 

once year is selected the month will appear

 

[2007][month]

 

once the month is selected the day will become available

 

[2007[june][day]

 

and when they select the day. they can submit.

Link to comment
https://forums.phpfreaks.com/topic/55878-solved-array/#findComment-276078
Share on other sites

Yeah...post this in the javascript forum.

 

I would probably be able type out a foundation code for you, but it would probably take me like 45 minutes, and I don't have the time right now. Someone in the JS forum will probably be able to show you in 5 minutes, hah.

 

Don't forget to put this topic as "solved"

Link to comment
https://forums.phpfreaks.com/topic/55878-solved-array/#findComment-276084
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.