Finding dates in a string

Discussion in 'PHP' started by Goosio, Jan 29, 2010.

  1. #1
    Hi...is there a function for locating dates within a string? I'd like to be able to extract the dates to other strings or arrays. The dates would be in the format January 29, 2010, or Jan. 29 without a year. I'd like to make sure there isn't already an easy way to do this before I try to reinvent the wheel. Thanks!
     
    Goosio, Jan 29, 2010 IP
  2. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You might be able to use the strtotime function to work it out, although it depends on what text is around the date text. Failing that, use a regular expression
     
    JAY6390, Jan 29, 2010 IP