PHP – sottrarre un giorno ad una data
0$newdate = date(‘Y-m-d’, strtotime(‘-1 day’, strtotime(date(“Y-m-d”))));
$newdate = date(‘Y-m-d’, strtotime(‘-1 day’, strtotime(date(“Y-m-d”))));
<?php $str = ‘abcdefg’; echo strlen($str); // 7 $str = ‘ ab cd ’; echo strlen($str); // 8 ?>
<?php $rev_array = array_reverse($array); // invertire ordine array echo array_pop($rev_array); // recuperare ultimo elemento array ?>
<?php $num = 5; $num = printf(‘%+d ‘, $num); ?> risultato: +5
<?php date (“d/m/Y”, strtotime (“-65 day”, mktime (date(“d/m/Y”)))) ?>
convertire anno/mese/giorno ora/minuti/secondi in millisecondi $dataGMA = “19-09-2012 09:42:47″; $T = 1000 * strtotime($dataGMA); output = 1348040567000 convertire i millisecondi in anno/mese/giorno ora/minuti/secondi $milliseconds = 1348040567000; $timestamp = $milliseconds/1000; echo date(“d-m-Y h:i:s”, $timestamp); output = 19-09-2012 09:42:47
il codice qui sotto restituisce a video la scritta Smemorando.com … il lavoro rende schiavi che è il risultato della conversione della stringa di dati da BASE64 ad ASCII Text il codice qui sotto restituisce a video la scritta U21lbW9yYW5kby5jb20gLi4uIGlsIGxhdm9ybyByZW5kZSBzY2hpYXZp che… Read more ›
Questo PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php5/20060613+lfs/mcrypt.so’ su Ubuntu solitamente è dovuto al fatto che apache2 cerca di caricare il modulo mcrypt che non è stato installato e che quindi non viene trovato, basta quindi lanciare… Read more ›