Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

196
Vistas
How to in PHP echo html tag and variable containig html tag?

Sample PHP code:

$a = "<ul><li>Some text</li></ul>";

and I want echo that with another html code:

<div>
  <?php echo "<p>".$a."</p>"; ?>
</div>

I suppose that list will be wrapped by 'p' which will be wrapped by 'div', but instead browser parse it like this:

<div>
  <p></p>
    <ul>
      <li>Some text</li>
    </ul>
  <p></p>
</div>

I don'n know what's wrong.

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda