PHP日期下拉输入到格式化输出

PHP日期下拉输入到格式化输出

本文介绍了PHP日期下拉输入到格式化输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要提供一个HTML页面,为MonthName,Day和Year提供3个下拉列表。当用户点击提交时,用户选择的日期现在以这种方式格式化:月#/日/年以及消息您已选择(日期)。



下拉列表必须使用PHP中的循环完成。我不确定如何让选定的May以5的形式出现。



我没有任何代码可以使用,因为我'我甚至不知道从哪里开始。我不确定如何让HTML元素与PHP交互。



任何想法都有帮助。我很难搞清楚,更不用说开始了。



如何以格式化的方式输出PHP下拉列表?

I need to come up with an HTML page that provides 3 dropdowns for MonthName, Day, and Year. When user hits Submit, the date that was selected by the user is now formatted in this way: Month#/Day/Year along with the message "You have selected (date)."

The dropdown list has to be done using loops in PHP. I'm not sure how to get a selected "May" to come out as "5."

I don't have any code to work from because I'm not even sure where to begin. I'm not sure how to get HTML elements to interact with PHP.

Any ideas are helpful. I'm having a hard time figuring it out, let alone getting started.

How can I get the PHP dropdown list to be output in the formatted way?

推荐答案


    // First thing to check is if user has submitted any data to this page via the form
    // We will use if-else condition here
    // The isset function checks if the variable of the given name exists or not. The



这篇关于PHP日期下拉输入到格式化输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 04:53