Bonjour,
je me suis intéressé à la doc de strip_tags : https://www.php.net/manual/en/function.strip-tags.php. On y lit cet exemple :Je l'ai testé sur 2 navigateurs (Firefox et Chrome) et dans les 2 cas, j'obtiens<?php
$text = '<p>Test paragraph.</p><!-- Comment --> <a href="#fragment">Other text</a>';
echo strip_tags($text);
echo "\n";
// Allow <p> and <a>
echo strip_tags($text, '<p><a>');
// as of PHP 7.4.0 the line above can be written as:
// echo strip_tags($text, ['p', 'a']);
?>
The above example will output:
Test paragraph. Other text
<p>Test paragraph.</p> <a href="#fragment">Other text</a>Comment expliquer ce mystère ?Test paragraph. Other text
Test paragraph.
Other text
Partager