Converting This into all PHP

 can anyone help me convert this into all PHP? Basically so the part in bold is all inside the php tags

[b]

<?php print($day);?>">[/b] <?php $day = 1; while($day <= 31) echo "$day"; $day++; ?>

Can you tell us a little about what you are trying to accomplish with the code?

creating a dropdown select box for the month of the year. This works but i want it all inside PHP. Im going to making it a function and using it as a include statement.

Hope this helps.

[php]<?php
$months = array (1 => ‘January’, ‘February’, ‘March’, ‘April’, ‘May’, ‘June’,‘July’, ‘August’, ‘September’, ‘October’, ‘November’, ‘December’);
$days = range (1, 31);
$years = range (2012, 2025);

//**********************************************
echo "Month: ";
foreach ($months as $value) {
echo ‘’.$value.’\n’;
} echo ‘’;

echo "Day: ";
foreach ($days as $value) {
echo ‘’.$value.’\n’;
} echo ‘’;

echo "Year: ";
foreach ($years as $value) {
echo ‘’.$value.’\n’;
}
?>
[/php]

nice code but how would i put that all into a function. So that i can call for in my html so i don’t have to have all that code on my html code page.

As an include just do this where ever you want the date selector at in your php.
[php]include ‘your_file_name.php’;[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service