Cannot strip all of the css and html tags and attributes from a web page with PHP

Hello! I am trying to remove any html tags which are taken using PHP Simple HTML DOM. I am using this link from Until now I only managed to get rid of the attributes` content and not the actual tags and css classes. Here is my code:

            $description = $html->find("iframe[id=desc_ifr]", 0);
            if($description != null){
                $source = $description->src;
            $descrHtml = getWebPage($source);
            $descrDom = new simple_html_dom();

                    foreach ($descrDom->find("#ds_div") as $key => $div) {                   
                        $descr = $div->innertext;
                        $cleandescr = preg_replace('/<[^>]*>/', '', $descr);
                        $cleandescription = trim(preg_replace('/\s+/',' ', $cleandescr));
                        $cleandescription1 = str_replace('img{max-width:100%}', '', $cleandescription);
                        $cleanedcss= preg_replace('~(?:\s*/\*.*?\*/\s*)|\{\K(?:\'[^\']*\'|"[^"]*"|/\*.*?\*/|(?:(?R)|[^}]))*~', '', $cleandescription1);
                        $cleanedclasses= str_replace('.center-page {} .push-left {} .qe td {} .qe .center {} .qe .label {} .qe .indent {} .qe .fit {} .limit-width {}', '', $cleanedcss);
                        $item['description'] = htmlspecialchars_decode(trim(str_replace("&nbsp;", "", $cleanedclasses)));  
                $item['description'] = '';

After debug I receive this result:
body {} h1 {} } h2, h3, h4, h5, h6 {} .navbar a, .navbar a:active, .navbar a:hover, .navbar a:visited {} .product-specs {} .product-specs td {} .attr-left {} .attr-right {} div.footer {} .navbar-default {} .navbar-default .navbar-nav > .active > a {}.col-md-6{} .col-md-12{} .container{} @media (min-width:768px){ .container{} .col-md-12, .col-md-6{} .col-md-6{} } @media (min-width:992px){ .container{} .col-md-12,.col-md-6{} .col-md-6{} } @media (min-width:1200px){ .container{} .col-md-12,.col-md-6{} .col-md-6{} } .img-responsive{}.nav{} .nav:before, .nav:after{} .nav:after{} .nav:before, .nav:after{} .nav:after{} .nav > li{} .nav > li > a{} .nav > li > a:hover, .nav > li > a:focus{} .nav > li > a > img{} .navbar{} @media (min-width:768px){.navbar{} } .navbar-header:before, .navbar-header:after{} .navbar-header:after{} .navbar-header:before, .navbar-header:after{} .navbar-header:after{} @media (min-width:768px){.navbar-header

That is NOT a link from ebay…

It is a link to google docs.

Please provide a REAL link
do not use a ‘shirt url’ anymore… I dont want to guess where you are sending me. I will no longer assist with those type of links/projects.

You can use php strip tags… or perhaps try the plaintext method in SIMPLEHTMLDOM?

quick example:

$html = file_get_html('');

$textOnlyCheck = $html->find('#prcIsum');

echo  $textOnlyCheck[0]->plaintext;
Sponsor our Newsletter | Privacy Policy | Terms of Service