我需要解析具有我以前从未见过的结构的文档。它看起来像这样:
<cat:707>
<begad:00216057>
<zip:48650>
<addr:2100 N. HURON RD, PINCONNING, MI USA>
COUNTRY 10 Mi. N. of Midland, 3 bedroom, 2 baths, appliances furnished, 300x500 finished pole barn on 5 acres, $750/mo. + utilities, 989-965-1118.
<endad>
<cat:710>
<begad:00216094>
<zip:48640>
<addr:1100 S HOMER RD, MIDLAND, MI USA>
IMMEDIATE Occupancy, extra clean, small 2 bedroom by nature center. Pet maybe/extra $400 deposit/references 839-4552
<endad>
我将如何在 php 中解析类似的内容以获取冒号之后的信息(即:707
第一个cat
)和之前的文本<endad>
?