tidy::head

tidy_get_head

(PHP 5, PHP 7, PECL tidy 0.5.2-1.0.0)

tidy::head -- tidy_get_head Retourne un objet tidyNode à partir de la balise <head>

Description

Style orienté objet

public tidy::head ( void ) : tidyNode

Style procédural

tidy_get_head ( tidy $object ) : tidyNode

Retourne un objet tidyNode à partir de la balise <head>.

Liste de paramètres

object

L'objet Tidy

Valeurs de retour

Retourne l'objet tidyNode.

Exemples

Exemple #1 Exemple avec tidy::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>

Voir aussi

  • tidy::body() - Retourne un objet TidyNode, commencé à partir de la balise <body>
  • tidy::html() - Retourne un objet tidyNode commençant à la balise <html>