previousInclure du Code (Previous) (Next) Commentaires d'En-têtenext

View this page in Last updated: Sun, 18 Oct 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

Tags dans le Code PHP

Utilisez toujours <?php ?> pour délimiter du code PHP, et non la version abrégée <? ?>. Cela est obligatoire pour être conforme aux règles de PEAR et c'est aussi la méthode la plus portable pour inclure du code PHP sur des systèmes d'exploitations disposant de configurations différentes.

previousInclure du Code (Previous) (Next) Commentaires d'En-têtenext

Download Documentation Last updated: Sun, 18 Oct 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
Note by: pear@ontheroad.net.nz
It's applicable in any script which ends with PHP code, e.g.

<?php
// Something here
?>

<div>Some HTML here</div>
<?php
// Some other code here?>
Note by: julian@gmail.com
Not including the closing ?> is only applicable when the file only contains PHP code.
Note by: pear at alan hogan.com
Drupal code styles suggest avoiding the final closing ?>.

They do so as to minimize the chance of content being sent by whitespace (sometimes inserted by FTP clients) after the closing town, which may prevent proper sending of headers.

Does PEAR care either way? Is it OK to avoid the final closing PHP tag?