Forum Moderators: coopster
;)
What is the "set structure" you are referring to? strtotime accommodates many formats. Will mktime [php.net] work better for you?
mktime() is from interger rather than strings. And its because strtotime() accepts many formats that I'd rather not use it. Take this example: mktime() is from integer rather than strings.
Right, you would need to parse out the pieces in order to pass them individually to the function in order to make your time.
I have a string containing a date lets say 01/02/2008. I know this is in the format dd/mm/yyyy but there is no way of telling strtotime this so it could parse it mm/dd/yyyy creating a mess of the rest of my code.
mm/dd/yyyy is a common U.S. writing and you are correct, strtotime will parse it as such. That is why I asked about your set structure. If you know the date will always come in as dd/mm/yyyy all you need to do is parse the pieces and build your timestamp from there.