Объединение нескольких элементов с помощью Simple HTML DOM

Это HTML, который я пытаюсь объединить:

<div class="post linkDetail">
  <div class="postThumbnail">
    <a href="/redirect?url=http%3A//blogs.msdn.com/archive/2012/04/23/how-to-improve-performance-in-your-metro-style-app.aspx">
      <img src="<validURL Here>" width="280">
    </a>
  </div>
  <p class="full-url">
    http://blogs.msdn.com/b/windowsappdev/archive/2012/04/03/how-to-improve-performa...
  </p>
  <p></p>
  <p>Nobody likes slow or unresponsive apps. Users expect that apps respond immediately to touch,   taps, clicks, gestures and key-presses. Users expect that animations are smooth, that they can play, pause and restart their music and videos quickly, and that they never have to wait for the app to catch up with them. This is the first in a series of posts on how to make your apps "fast and fluid."    
   </p>
   <p>We invested a lot of time in the engineering teams thinking about how we can ensure the performance of Metro style apps. We have learned what we can do in the platform to deliver on fast and fluid performance and have also learned what works and what does not work in building apps that deliver great experiences. In this blog I share with you some of the hard lessons from our own experiences so that you can build the best possible experiences for your customers.</p><p>Performance is more than just a stopwatch and efficient algorithms. When I think of performance, I like to take a holistic ...
   </p>
</div>

Я хочу взять весь контент <p> после элемента p.full-url и объединить все элементы <p> в одну текстовую строку.

Так что это:

  <p></p>
  <p>Nobody likes slow or unresponsive apps. Users expect that apps respond immediately to touch,   taps, clicks, gestures and key-presses. Users expect that animations are smooth, that they can play, pause and restart their music and videos quickly, and that they never have to wait for the app to catch up with them. This is the first in a series of posts on how to make your apps "fast and fluid."    
   </p>
   <p>We invested a lot of time in the engineering teams thinking about how we can ensure the performance of Metro style apps. We have learned what we can do in the platform to deliver on fast and fluid performance and have also learned what works and what does not work in building apps that deliver great experiences. In this blog I share with you some of the hard lessons from our own experiences so that you can build the best possible experiences for your customers.</p><p>Performance is more than just a stopwatch and efficient algorithms. When I think of performance, I like to take a holistic ...
   </p>

Становится:

Никто не любит медленные или не отвечающие приложения. Пользователи ожидают, что приложения немедленно реагируют на прикосновения, касания, щелчки, жесты и нажатия клавиш. Пользователи ожидают, что анимация будет плавной, что они смогут быстро воспроизводить, приостанавливать и перезапускать музыку и видео и что им никогда не придется ждать, пока приложение их догонит. Это первая статья из серии статей о том, как сделать ваши приложения «быстрыми и плавными». Мы потратили много времени на то, чтобы инженеры думали о том, как мы можем обеспечить производительность приложений в стиле Metro. Мы узнали, что мы можем сделать на платформе, чтобы обеспечить быструю и плавную работу, а также узнали, что работает, а что нет при создании приложений, обеспечивающих отличные впечатления. В этом блоге я поделюсь с вами некоторыми трудными уроками из нашего собственного опыта, чтобы вы могли создать наилучший возможный опыт для своих клиентов. Производительность — это больше, чем просто секундомер и эффективные алгоритмы. Когда я думаю о производительности, я предпочитаю целостное...

Возможно ли это в простой HTML DOM?


person CLiown    schedule 08.04.2012    source источник


Ответы (1)


Я никогда не использовал простой html dom, но я думаю, что это то, что вам нужно:

$result = '';
foreach($html->find('p') as $p) {
   $result .= strip_tags($p->plaintext);
}
person André    schedule 20.04.2012