Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

tidy_parse_string, notice

3 réponses
Avatar
Jean-Francois
Bonjour j'ai un petit soucis avec la commande tidy_parse_string
tout fonctionne correctement mais j'ai un warning à la ligne
$tidy = tidy_parse_string($resulthtml, $Ar_config, 'UTF8');

cela ne dois pas être grand chose mais je seche ..
j'ai besoin d'une explication ..
merci



voici le warning et la code

Notice: Array to string conversion in
/home/jf/workspace/tyacht/application/core/template.class.php on line 392


$Ar_config = array(
// 'clean' => true,
'language' =>$lang,
'bare' => true,
'indent-spaces' => false,
'tab-size' => true,
'wrap' => false,
'preserve-entities' => true,
'break-before-br' => false,
'indent' => false,
'output-xhtml' => true,
'hide-comments' => false,
'join-styles'=>true,
'indent-attributes'=> false,
'wrap' => 0);


$tidy = tidy_parse_string($resulthtml, $Ar_config, 'UTF8');
$tidy->cleanRepair();
$htmlcache = $doctype.tidy_get_output($tidy);

3 réponses

Avatar
Mickael Wolff
Le 27/06/2010 12:34, Jean-Francois a écrit :
Bonjour j'ai un petit soucis avec la commande tidy_parse_string



De quelle extension ? Parce que bon, elle n'est pas présente dans la
référence sur Tidy
<http://ie2.php.net/manual/fr/function.tidy-set-encoding.php>

--
Mickaël Wolff aka Lupus Michaelis
http://lupusmic.org
Avatar
Olivier Miakinen
Bonjour,

Le 27/06/2010 13:34, Jean-Francois a écrit :
[...] j'ai un warning à la ligne
$tidy = tidy_parse_string($resulthtml, $Ar_config, 'UTF8');

Notice: Array to string conversion in
/home/jf/workspace/tyacht/application/core/template.class.php on line 392



Donc c'est un tableau (array) qui est passé là où une chaîne (string)
est attendue, et on te prévient que la conversion a été faite
automatiquement.

$Ar_config = array(
// 'clean' => true,
'language' =>$lang,
'bare' => true,
'indent-spaces' => false,
'tab-size' => true,
'wrap' => false,
'preserve-entities' => true,
'break-before-br' => false,
'indent' => false,
'output-xhtml' => true,
'hide-comments' => false,
'join-styles'=>true,
'indent-attributes'=> false,
'wrap' => 0);


$tidy = tidy_parse_string($resulthtml, $Ar_config, 'UTF8');



J'ai trouvé la doc de cette fonction ici :
<http://www.manuelphp.com/php/function.tidy-parse-string.php>

Il est clair que le deuxième paramètre peut être un array, le problème
n'est donc pas là. Et $resulthtml, c'est bien une string ? Si oui, le
problème est peut-être le paramètre $lang dans $Ar_config['language'] ?
Est-ce que tu n'aurais pas mis un tableau là où on attendrait une chaîne
de caractères ?

Cordialement,
--
Olivier Miakinen
Avatar
Jean-Francois
J'ai trouvé
la variable $lang n'était pas assignée ...


désolé pour le bruit

JF TANGUY