-6

Possible Duplicate:
How to parse and process HTML with PHP?

I have HTML code and i need get 1st DIV block

<div class="right-catalog-item"><b>Accessories 1</b></div>

after i need get from 1st DIV block get internal DIV block

<div style="margin-left: 10px;">

from this code:

<div class="right-catalog-item"><b>Accessories 1</b></div>
<div style="margin-left: 10px;">
    <div class="right-catalog-item"><a href="/catalog/type/25/">item 1</a></div>
    <div class="right-catalog-item"><a href="/catalog/type/10/">item 2</a></div>
    <div class="right-catalog-item"><a href="/catalog/type/60/">item 3</a></div>
</div>
<div class="right-catalog-item"><a href="/catalog/type/2/"><b>Accessories 1</b></a>
</div>
<div class="right-catalog-item"><a href="/catalog/type/1/"><b>Accessories 1</b></a></div>
<div class="right-catalog-item"><a href="/catalog/type/27/"><b>Accessories 1</b></a></div>
<div class="right-catalog-item"><a href="/catalog/type/19/"><b>Accessories 1</b></a></div>
<div class="right-catalog-item"><a href="/catalog/type/5/"><b>Accessories 1</b></a></div>
<div class="right-catalog-item"><a href="/catalog/type/4/"><b>Accessories 1</b></a></div>
<div class="right-catalog-item"><a href="/catalog/type/70/"><b>Accessories 1</b></a></div>
<div class="right-catalog-item"><a href="/catalog/type/12/"><b>Accessories 1</b></a></div>
Community
  • 1
  • 1
Stas
  • 13
  • 1
  • 4

1 Answers1

-3

If you already know Jquery You can use PHP Query :

http://code.google.com/p/phpquery/

You can also find enough documantation there.

chickens
  • 19,976
  • 6
  • 58
  • 55
  • 1
    PHP's native DOMDocument can easily do the job. jQuery and its PHP counterparts are not the answer for everything. – Madara's Ghost Aug 17 '12 at 09:28
  • I used DOMDocument many times and its way faster than PHP Query. But for easy jobs, and if the DOM is incorrect in several ways, PHP Query is easier to deal with. – chickens Aug 17 '12 at 09:34