Documentación offline PHP master

tidy::head

master Ver versión oficial en línea Licencia CC-BY-3.0Descargado el 2026-08-02

En esta página

tidy::head

tidy_get_head

Devuelve un objeto

tidyNode

empezando con la etiqueta \<head>

Descripción#

Estilo orientado a objetos

public tidy::head(): tidyNode
```php

Estilo procedimental

```php
tidy_get_head(tidy $tidy): tidyNode

Devuelve un objeto tidyNode empezando por la etiqueta \<head>.

Parámetros#

tidy
El objeto Tidy

Valores devueltos#

Devuelve el objeto tidyNode.

Ejemplos#

Ejemplo de tidy::head

<?php
$html = '
<html>
  <head>
    <title>test</title>
  </head>
  <body>
    <p>parrafo</p>
  </body>
</html>';

$tidy = tidy_parse_string($html);

$head = $tidy->head();
echo $head->value;
?>

El ejemplo anterior mostrará:

<head>
<title>test</title>
</head>

Véase también#

tidy::body

tidy::html