Content about Java ERP Solution for Reviews Best ERP Software for sale and Free Software with Java OpenSource for Free Download

PHP Remove HTML Tag Cleaning Text

We can parse HTML page to collect only normal text with PHP function  strip_tags()
for example to using this functoin in bilow

Example to using  PHP strip_tags()

    $html_page="<a href='test.php'>This is my page </a>";  
   $txt.=strip_tags($html_page);  

The output is return
This is my page yes

Note** If we have complex HTML page the output is not perfect we need to clean it self for example
   $description.=" ".strip_tags(trim($html_page))." ".$main_term;  
   $description = ereg_replace( "\n", " ", $description);  
   $description = ereg_replace( "\r", " ", $description);  
   $description = ereg_replace( " ", " ", $description);  
   $description = ereg_replace( " ", " ", $description);  
   $description = ereg_replace( " ", " ", $description);  
   $description = ereg_replace( " ", " ", $description);