, - , , 00/00/00 [00] - , , mm/dd/yy [yy], dd/mm/yy [yy]. strtotime locale , .
, preg . :
/([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{2,4})/
gives an array
0=> 02/06/2011
1=> 02
2=> 06
3=> 2011
Then use mktime to create a unix timestamp.
Other approaches include using substr to retrieve a fixed-length string, or using a space to retrieve words.
source
share