Ver Mensaje Individual
  #2 (permalink)  
Antiguo 10/07/2010, 13:56
Avatar de abimaelrc
abimaelrc
Colaborador
 
Fecha de Ingreso: mayo-2009
Ubicación: En el planeta de Puerto Rico
Mensajes: 14.734
Antigüedad: 15 años
Puntos: 1517
Respuesta: Espacios en blanco en respuesta consulta

Trata no usando la etiqueta de cierre ?>. Cuando el código es PHP puro no es necesario usar la etiqueta de cierre y asegúrate que no tengas espacios en la primera etiqueta.

Edito:
Mira lo que dice este comentario del libro Zend PHP 5 Certification
Cita:
Newline Characters

It is important to remember that every character outside of PHP tags is copied as-is
by the interpreter to the script’s output—and this includes newline characters.
Newlines are, normally, ignored by browsers, as they are non-semantic characters
in HTML. However, they are also used as separators between the header portion of
a web server’s HTTP response and the actual data; therefore, outputting a newline
character before all of the headers have been written to the output can cause some
rather unpleasant (and unintended) consequences. To mitigate this problem, the
first newline directly after a closing tag (?> only) is stripped by the parser. Doing so
also solves a problem introduced by the fact that a number of popular text editors
will automatically prepend a newline to the end of your file, thus interfering with
include files which are not supposed to output any text

An easy way to prevent spurious output from an include file is to omit the closing tag
at the end, which the parser considers this perfectly legal.
__________________
Verifica antes de preguntar.
Los verdaderos amigos se hieren con la verdad, para no perderlos con la mentira. - Eugenio Maria de Hostos

Última edición por abimaelrc; 10/07/2010 a las 14:05