phpquery sorun kullanarak href çıkarmadan

0 Cevap php

Merhaba ben burada bir ekran hurda sitenin bağlantısını kaldırmak için gereken çıkış kaynağıdır.

<div class="FourDayForecastContainerInner">
<span class="day">Friday</span>
    <a href="forecastPublicExtended.asp#Period4" target="_blank">
        <img src="./images/wimages/b_rain.gif" class="thumbnail">
    </a>
    <span class="hi">
        <span style="width:24px;">Hi</span> 
        19 / 66
    </span>
    <span class="lo">
    <span style="width:24px;">Lo</span> 
        16 / 60
    </span>

    <span class="description">
    Sunny Breaks,  showers
    </span>
</div>

<div class="FourDayForecastContainerInner">
    <span class="day">Saturday</span>

ve burada benim kod Im phpquery kullanıyor

$doc = phpQuery::newDocumentHTML( $e );  
$containers = pq('.FourDayForecastContainerInner', $doc); 
foreach( $containers as $container ) {
  $div = pq('span', $container);
  $img = pq('img', $container);
  $div->eq(0)
      ->removeAttr('style')
      ->addClass('day')
      ->html( 
        pq( 'u', $div->eq(0) )
        ->html() 
      );

  $img->eq(0)
      ->removeAttr('style')
      ->removeAttr('height')
      ->removeAttr('width')
      ->removeAttr('alt')
      ->addClass('thumbnail')
      ->html( pq( 'img', $img->eq(0)) );   

  $div->eq(1)
      ->removeAttr('style')
      ->addClass('hi');  

  $div->eq(3)
      ->removeAttr('style')
      ->addClass('lo'); 

  $div->eq(5)
      ->removeAttr('style')
      ->addClass('description');   
} 
print $doc; 

I have manage to remove all attributes styles height width etc. but i can't seem to remove the a href thank you so much for your help

0 Cevap