Forum und email

tidy_get_head

(PHP 5, PECL tidy:0.5.2-1.0)

tidy_get_head — Retourne un objet TidyNode à partir de la balise <head>

Description

Style procédural

tidyNode tidy_get_head ( tidy $object )

Style orienté objet (méthode)

tidyNode tidy->head ( void )

tidy_get_head() retourne un objet tidyNode à partir de la balise <head>.

Example#1 Exemple avec tidy_get_head()

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

$tidy tidy_parse_string($html);

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

L'exemple ci-dessus va afficher :

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

Note: Cette fonction n'est disponible qu'avec le Zend Engine 2, c'est à dire PHP >= 5.0.0.

Voir aussi tidy_get_body() et tidy_get_html().