Ver Mensaje Individual
  #1 (permalink)  
Antiguo 05/03/2017, 12:48
JimmyBrain
 
Fecha de Ingreso: noviembre-2014
Mensajes: 46
Antigüedad: 9 años, 5 meses
Puntos: 0
Mostrar mucho código HTML en PHP

Hola , tengo una duda, sin usar plantillas, cual de estas formas seria mejor para mostrar mucho codigo HTML , para ser legible :

Metodo 1 :

Código PHP:
Ver original
  1. if (is_single()) {
  2. //now we just close PHP tag
  3. ?>
  4. </style>
  5. <script>
  6. <blah blah blah>
  7. <?php
  8. //open it back. here is your PHP again. easy!
  9. }
  10. ?>

Metodo 2 :

Código PHP:
Ver original
  1. echo <<< EOT
  2.     in here is your string
  3.     it has the same variable substitution rules
  4.     as a double quoted string.
  5.     when you end it, put the indicator word at the
  6.     start of the line (no spaces before it)
  7.     and put a semicolon after it
  8. EOT;

El primero me queda raro pero es comodo y el segundo no me convence, pero lei que se usan mucho las dos formas.

¿ Cual es mejor ?