How does strtotime treat arrays?

Source: Internet
Author: User
How does strtotime treat arrays? Yes. to submit a form, replace the time in date format with the timestamp. Previously, strtotime & nbsp; was used directly, but because the form needs to be clicked to add rows as needed, now all fields are converted into arrays, for example, & lt; td & gt; & lt; input & nbsp; typetext & nbsp; namedate [] & nbsp; how does style strtotime treat arrays?
In this case, when submitting a form, replace the time in date format with the timestamp. Previously, strtotime was used directly, but because the form needs to be clicked to add rows as needed, now all fields are converted into arrays, for example:
 


A js plug-in is used to directly select the time. arrays are not used in the past, as follows:
 


After the date field is added, [] is changed to date [], which is based on the array post,
Processing page, if not an array, directly
$date =strtotime($_post[date]) 

You can directly convert it into a timestamp, but now it is an array. if you use:
$date_arr =strtotime($_post[date]) 

An error is reported, but the database cannot be inserted. how can this problem be solved?

Time stamp strtotime array


------ Solution --------------------
$ Date_arr = array_map ('strtotime', $ _ POST ['Date']);

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.