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

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -