fgetss()的BUG及纠正

*/ 
function mygets($myFile

//while(!feof($myFile)) 
//{ 
$myline fgets($myFile255); 

$big=strlen(strstr($myline,">")); 
$small=strlen(strstr($myline,"<")); 
if(
$big>$small//此句很重要,如果HTML代码中间有换行时有用 
//如果一行中首先出现的是>而不是<时有用 
$myline=strstr($myline,">"); 
$myline=substr($myline,1); 


$len=strlen($myline); 
$startskip=false
$outstring=""//important! 

for($i=1;$i<=$len;$i++) //去掉所有HTML代码 

$a=substr($myline,$i-1,1); 
switch(
$a

case 
"<"
$startskip=true
//$myline=substr($myline,">"); 
//$myline=strstr($myline,1); 
break; 
case 
">"
//$myline=substr($myline,1); 
$startskip=false
break; 
default: 

if(!
$startskip && $a!=">"$outstring=$outstring.$a

$outstring=str_replace("&nbsp;"," ",$outstring); 
//当然,以&开头的东东如果不想要可以再加,如法炮制,这里只是过滤&nbsp; 
$outstring=str_replace(" ","",$outstring); 
$outstring=str_replace(" ","",$outstring); //双引号内为全角空格 
$outstring=str_replace("\n","",$outstring); 
return 
$outstring
//} 

?>