Posted By

gfazioli on 10/30/08


Tagged

php pregreplace


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

gfazioli
basicmagic


PHP plain date


 / Published in: PHP
 

URL: http://www.undolog.com

Format from "yyyy-mm-dd hh:mm:ss" to "yyyymmddhhmmss"

  1. function plainDate( $d ) {
  2. return( preg_replace( '/(-|:|\040)/', '', $d ) );
  3. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: Scooter on October 30, 2008

Avoiding the built-in date() function for some reason? http://ca.php.net/manual/en/function.date.php

Posted By: gfazioli on January 7, 2009

If source $d is a string ...

You need to login to post a comment.