Sehr kurze Auszug: PHP-Ebene Daten

. Wandelt ein Datum im Format yyyy-mm-dd hh:mm:ss zu yyyymmddhhmmss . Hilfreich, die Funktionen der Bestellung, die Art zu nutzen asort() .

1
2
3
4
5
6
/ **
* Format von "yyyy-mm-tt hh: mm: ss" auf "yyyymmddhhmmss"
* /
$d ) { plainDate Funktion ($ d) {
preg_replace ( '/(-|:|\040)/' , '' , $d ) ) ; return ( preg_replace ('/ (- |: | \ 040) /','', $ d));
}

Es ist besser als dies:

1
2
3
$d ) { plainDate Funktion ($ d) {
str_replace ( ' ' , '' , str_replace ( '-' , '' , str_replace ( ':' , '' , $d ) ) ) ) ; return ( str_replace ('','', str_replace ('-','', str_replace (':','', $ d))));
}

Oder auch dies:

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

Ein Kommentar: "Sehr kurze Auszug: PHP-Ebene Daten"

  1. 5. November 2008 Snippet: Spiel mit Terminen in PHP | Napolux.com :

    [...] Sieben über seinen Blog, stieß ich auf dieses Thema liegt. Sein Snippet (das können Sie Datumsformat yyyy-mm-tt hh konvertieren: mm: ss yyyymmddhhmmss) [...]

Hinterlasse einen Kommentar

TAG XHTML Papiere: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> Platzhalter-Codes:
 <pre></pre> // blocco generico <code></code> // blocco generico [cc_actionscript][/cc_actionscript] // Actionscript [cc_actionscript3][/cc_actionscript3] // Actionscript 3 [cc_css][/cc_css] // CSS Style Sheet [cc_html][/cc_html] // HTML [cc_js][/cc_js] // Javascript [cc_objc][/cc_objc] // Objective-C [cc_php][/cc_objc] // PHP [cc_sql][/cc_sql] // SQL 


Stop SOPA