1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Extract day/month/year from this

Discussion in 'PHP' started by Fracisc, Feb 16, 2010.

  1. #1
    I cannot manage to extract day/month/year from this format: March 1, 1981

    Is there anyone who can help me? I need the month converted to "03".
     
    Fracisc, Feb 16, 2010 IP
  2. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #2
    <?php
    
    $extract = strtotime("March 1, 1981");
    
    //output: 01/03/1981
    echo date("d/m/Y", $extract);
    ?>
    PHP:
     
    danx10, Feb 16, 2010 IP
    Fracisc likes this.