![]() |
PHP Array?
I am trying to combine several variables into one PHP array (I think)
Basically the user keys in the date and time into 6 boxes: YYYY MM DD HH MM SS I am then trying to combine those fields into one array. Whatever I'm doing is not working and I'd really appreciate some help. PHP Code:
|
Looks to me that you mean a string, not an array.
To convert that to an array, you'd simply wrap it in array(). So that would be array($start_year, . . ., $start_seconds);.What you want is a string. I'd recommend a sprintf as its simple. PHP Code:
Code:
<input type="text" name="inputDate[year]" />Edit: BTW, if you split up the date from the time strings, you can parse it easily using strtotime or new DateTime objects. This makes it easier to deal with other calculations based on time as well as letting you format it however you want. PHP Code:
|
| All times are GMT +1. The time now is 05:04 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.