How To Display Current Year in PHP Come visualizzare anno in corso in PHP
The most common use of this is to display the current year in the copyright message dynamically. L'utilizzo più comune di questo è visualizzare l'anno in corso nel diritto d'autore messaggio dinamicamente. Anyone who really knows PHP should be able to do it easily. Nessuno sa davvero che PHP dovrebbe essere in grado di farlo facilmente. However not everyone who has to use PHP knows PHP, like, for example, people using snippets in ModX or modifying templates in WordPress. Tuttavia non tutti che è quello di usare il PHP sa PHP, come, ad esempio, persone che usano snippet in ModX o modificare i modelli di WordPress. Here is the code snippet for them: Qui è il frammento di codice per loro:
Filed under Elencato sotto How To Come , Open Source Software Software open source , PHP , Programming Programmazione , Web , Web 2.0 2,0 web , WordPress | |
| |
RSS 2.0 RSS 2,0 | |
Trackback this Article | questo articolo |
Email this Article Invia questo articolo
You may also like to read Si può anche leggere come |





March 1st, 2008 at 12:25 pm 1 ° marzo 2008, 12:25 pm
You might have better luck with the following since your PHP tag is incorrect: Si potrebbero avere migliori fortuna con il seguente dato che il tuo tag di PHP non è corretto:
March 1st, 2008 at 12:28 pm 1 ° marzo 2008, 12:28
Um er… Your comment filter killed my code so here it is: Um er… Il tuo commento filtro ucciso mio codice in modo che qui è:
<?php date(’Y'); ?> <? php data ( 'Y');?>
March 1st, 2008 at 12:29 pm 1 ° marzo 2008, 12:29 pm
3rd Try is the charm: 3a Prova è il fascino:
<?php date(’Y'); ?> <? php data ( 'Y');?>
March 2nd, 2008 at 3:14 am Mar 2, 2008 3:14 am
The code is correct. Il codice è corretto. Semicolon is not required before ending PHP tag. Virgola non è richiesto prima dello spegnimento PHP tag.
March 2nd, 2008 at 1:14 pm Mar 2, 2008 1:14 pm
You are right that the ending semi-colon is not required but the “?” is required to set off the PHP tag it won’t be parsed and will not appear as the browser will parse it as if it were an unknown HTML element. Hai ragione a dire che il finale punto e virgola non è richiesta, ma il "?" È necessario per impostare il tag di PHP non sarà analizzato e non appariranno come il browser analizzare come se fosse uno sconosciuto elemento HTML.