Php code to remove text in HTML Tags

function replaced($b1,$b2,$file)
{
//echo”

“;
//echo “
“;
//echo”

“;
$b1a=str_split($b1);
//print_r($b1a);
$c1a=count($b1a);
$file1=str_split($file);
$c1=count($file1);

for($i=0;$i<$c1;$i++)
{
//$a1=$file1[$i].$file1[$i+1].$file1[$i+2].$file[$i+3].$file[i+4];
$k=$i+$c1a;
for($l=$i;$l<$k;$l++)
{
$a1=$a1.$file1[$l];
}

//echo $a1;

//echo "
“;
if($a1==$b1)
{
//echo $a1;
$j=$i+$c1a;
while($file1[$j]!=$b2)
{

$file1[$j]=”";
// echo $file1[$j];
//echo”
“;
// echo $j;
$j++;
}

}
else
{

}
$a1=”";
}
//print_r($file$1);
$file=implode(”",$file1);
return($file);
}

$file=file_get_contents(”hotel1.html”);
$file=replaced(”“,$file);
$file=replaced(” “,$file);
$file=replaced(”
“,$file);
$file=replaced(”
“,$file);
$file=preg_replace(”//i”,”",$file);
$file=preg_replace(”/<\/font>/i”,”",$file);
$file=preg_replace(”//i”,”",$file);
$file=preg_replace(”/<\/b>/i”,”",$file);
$file=replaced(”“,$file);
$file=replaced(”“,$file);
$file=replaced(”“,$file);
$file=replaced(”“,$file);

This entry was posted on Wednesday, October 8th, 2008 at 7:40 pm and is filed under Php. You can follow any responses to this entry through the RSS 2.0 feed. Responses are currently closed, but you can trackback from your own site.

Comments are closed.