Sehr kurze Auszug: PHP Plain Tag

Freitag, 31. Oktober 2008

Konvertiert ein Datum-Format yyyy-mm-dd hh:mm:ss zu yyyymmddhhmmss Hilfreich, die Funktionen der Bestellung zu nutzen; Typ asort()

PHP:
  1. / **
  2. * Format von "yyyy-mm-dd hh: mm: ss" auf "YYYYMMDDHHMMSS"
  3. * /
  4. $d ) { PlainData Funktion ($ d) (
  5. preg_replace ( '/(-|:|\040)/' , '' , $d ) ) ; return (preg_replace ('/(-|:| \ 040) /','', $ d));
  6. )

Besser als diese:

PHP:
  1. $d ) { PlainData Funktion ($ d) (
  2. str_replace ( ' ' , '' , str_replace ( '-' , '' , str_replace ( ':' , '' , $d ) ) ) ) ; return (str_replace ('','', str_replace ('-','', str_replace ($ d':','', ))));
  3. )

Oder auch dies:

PHP:
  1. $d ) { PlainData Funktion ($ d) (
  2. explode ( ' ' , $d ) ; $ Pd = explode ('', $ d);
  3. explode ( '-' , $pd [ 0 ] ) ; $ Dd explodieren = ( '-', $ pd [0]);
  4. explode ( ':' , $pd [ 1 ] ) ; $ PS explodieren = ( ':', $ pd [1]);
  5. $dd [ 0 ] . $dd [ 1 ] . $dd [ 2 ] . $hp [ 0 ] . $hp [ 1 ] . $hp [ 2 ] ) ; return ($ dd [0]. $ dd [1]. $ dd [2]. $ PS [0]. $ PS [1]. $ HP [2]);
  6. )

Verwandte Post

War dieser Artikel hilfreich?: Per nientePocoAbbastanzaMoltoMoltissimo
Loading ... Loading ...

Ein Kommentar zu "Sehr kurze Auszug: PHP Plain Datum"

  1. getAvatar 1,0
    Der 05. November 2008 Snippet: Spiel mit Daten in PHP | Napolux.com:

    [...] Der Blick durch seinen Blog, stieß ich auf diesem Beitrag. Seine snippet (das Datum das Format jjjj-mm-dd hh: mm: ss zu YYYYMMDDHHMMSS) wandelt [...]

Leave a comment

TAG XHTML Berechtigungen: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> INSERTION CODE:
 <pre></pre>         // blocco generico [code][/code]       // blocco generico [as][/as]           // Actionscript [css][/css]         // CSS Style Sheet [html][/html]       // HTML [js][/js]           // Javascript [objc][/objc]       // Objective-C [php][/php]         // PHP [sql][/sql]         // SQL