$_get Date Function

Discussion in 'PHP' started by sam20e, Feb 13, 2013.

  1. #1
    hi

    i use this :

    $date_new=$_GET['year']."-".$_GET['month']; from a form and i used to display the value like this :

    <b>Captured Date :</b> <?php echo $date_new; ?>

    Its working fine, how ever the output it like = 2013-01. I want it to be 2013-Jan

    How can i use dateformat in this code?

    Thanks
     
    sam20e, Feb 13, 2013 IP
  2. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #2
    EricBruggema, Feb 13, 2013 IP
    ryan_uk likes this.
  3. sam20e

    sam20e Member

    Messages:
    57
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    45
    #3
    thanks
     
    sam20e, Feb 13, 2013 IP
  4. EricDoc

    EricDoc Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #4
    or you can use str_replace
    ex:
    $arr = array('01', '02');
    $arr1 = array('Jan', 'Sec');
    str_replace($arr1, $arr);
     
    EricDoc, Feb 14, 2013 IP