php - How to display words before last character / of a date? -


i have date in format "2015/06/15". want "2015/06" output string.

how that?

you can several way: like:

  1. echo date("y/m", strtotime("2015/06/15"))
  2. $arrdt = explode("/", "2015/06/15"); $newdt = $arrdt[0]."/".$arrdt[1];

Comments

Popular posts from this blog

iis - ASP.Net Core CreatedAtAction in HttpPost action returns 201 but entire request ends with 500 -

gcc - Neither ld wrap nor LD_PRELOAD working to intercept system call -

ssh - Vagrant Windows - ssh_exchange_identification: read: Connection reset by peer -