Browser vs CLI: different behaviour strip_tags()
| From: | Jeroen Houben | Date: | Wed, 03 Sep 2003 11:12:48 +0000 |
| Subject: | Browser vs CLI: different behaviour strip_tags() | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-161533@lists.php.net to get a copy of this message | ||
Hi,
Running the same script from the command line and in a browser generates different results. In the browser a cleaned up HTML string is returned whereas on the command line I get nothing..
Could someone please test the following code in a browser and on a CLI and let me know if they exprerience the same problem? I'm using PHP 4.3.2
Thanks,
Jeroen
<?php
$text =
'
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> <head>
<title></title></head> <body bgcolor="#FFFFFF" link="blue" vlink="purple" lang="EN-US">
<div class="Section1">
<h1>1. Some title</h1>
<p><span lang="EN-GB">Some text </span></p>
</div>
</body>
</html>
';
$text = strip_tags($text, '<table><tr><th><td><a><ul><li><ol><p><h1><h2><h3><h4><h5><h6>');
print($text);
print "\n";
?>