php - Combining an Time / Date Array to convert to UNIX TIME -


so have form creating scheduled dates. title, subject, bla bla... then, have jquery date picker, lets user pick date off calendar. jquery date picker formats human dates want store them in unix time. have calendar, year, month, day... have standard drop down hour, 1:00 pm, 1:30 pm etc...

the post print_r($_post); looks this,

[time] => array     (         [0] => 5:00 pm         [1] => 1:00 pm         [2] => 8:00 pm     )  [date] => array     (         [0] => 2014-05-08         [1] => 2014-04-04         [2] => 2014-03-28     ) 

i found strtotime(); converting, human time / date unix time, however... how array [0] time, , date combine , combined string. there might 1 date, or 8 dates?!

you can iterate through post data , combine times:

foreach($_post['date'] $i => $date) {     $timestamp = strtotime($date.' '.$_post['time'][$i]); } 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -