0

我有一张桌子,employee在那张桌子上我有one column named birthdate那个商店date in 2012/4/5 format

在我的 php 页面中3 drop down menu called year, month and date

谁能帮我...如何将日期提取到 3 个不同的下拉菜单中?谢谢

4

2 回答 2

1

您可以为此使用explode functin:

 <body>
 <?php
 $date = '2012/4/5';
 $date = explode('/',$date);
 ?>
 <select name="year">
     <option value="year"><?php echo $date[0]; ?></option>
 </select>
 <select name="month">
     <option value="month"><?php echo $date[1]; ?></option>
 </select>
 <select name="day">
     <option value="day"><?php echo $date[2]; ?></option>
 </select>
 </body>
于 2013-05-23T09:36:00.367 回答
1
in your PHP code use split method like this:

list($y,$m,$d) = split("/",$dob); // 2012/4/5

then use $y, $m and $d value as you want.
于 2013-05-23T09:27:08.617 回答