|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-02-02 04:06 UTC] airtravel at anet dot ne dot jp
fgetss() funcion of PHP4.3.0 doesn't work in any way. strip_tags(fgets()) works fine. Scripts are working fine with <PHP4.2.3. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 04:00:02 2025 UTC |
Thank you for your comments. I found this problem only occurs when parsing specific html. Please try the following URL to see my problem. Thank you. <?php $fp = fopen("http://adds.aviationweather.gov/projects/adds/metars/index.php?metarIds=ksfo", "r"); while (($line=fgetss($fp, 4096))!==FALSE) { echo $line; } fclose($fp); ?> <?php $fp = fopen("http://adds.aviationweather.gov/projects/adds/metars/index.php?metarIds=ksfo", "r"); while (($line = strip_tags(fgets($fp, 4096)))!==FALSE) { echo $line; } fclose($fp); ?>This code : <?php print "Test one :".strip_tags('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD><TITLE>Some title</TITLE> <META content="text/html; charset="ISO-8859-1" http-equiv=Content-Type>') ."<br>"; print "-----------<br>"; print "Test two :".strip_tags('<DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD><TITLE>Some title</TITLE> <META content="text/html; charset="ISO-8859-1" http-equiv=Content-Type>') ."<br>"; print "-----------<br>"; print "Test three :".strip_tags('<!FOO BAR> real text <br>') ."<br>"; ?> Gives me : Test one : ----------- Test two : Some title ----------- Test three : Any "<!SOMETHING..." strips all !!