(PHP 5, PECL tidy:0.5.2-1.2)
tidy_getopt — Retourne la valeur de l'option de configuration Tidy
Style procédural
mixed tidy_getopt ( tidy $object, string $option )Style orienté objet (méthode)
mixed tidy->getOpt ( string $option )tidy_getopt() retourne la valeur de l'option spécifiée option pour l'objet object . Le type retourné dépend du type de l'option spécifiée option . Vous pouvez trouver une liste de chaque option de configuration ainsi que leur type à : » http://tidy.sourceforge.net/docs/quickref.html .
Exemple 2726. Exemple avec tidy_getopt()
<?php
$html
=
'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html><head><title>Title</title></head>
<body>
<p><img src="img.png"></p>
</body></html>'
;
$config
= array(
'accessibility-check'
=>
3
,
'alt-text'
=>
'du texte'
);
$tidy
= new
tidy
();
$tidy
->
parseString
(
$html
,
$config
);
var_dump
(
$tidy
->
getOpt
(
'accessibility-check'
));
//integer
var_dump
(
$tidy
->
getOpt
(
'lower-literals'
));
//boolean
var_dump
(
$tidy
->
getOpt
(
'alt-text'
));
//string
?>
L'exemple ci-dessus va afficher :
int(3) bool(true) string(9) "some text"