HTML Parse Issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am having a issue parsing an html file. 

I want to pull all the data between two html tags.

 

Problem I am having is that no matter what I try  I can pull either tag or
both but not the data in between.

<div class="record" id="one">

                <div class="rideon">

                                <h2>

                                                <span>Welcome to
Rideon</span>

                                </h2>

                </div>

</div>

</div class="record" id="one">

 

function datamatch($document)

{

                preg_match_all('/<div class="record" [^<>]*>(.*)/<\/div
class="record" [^<>]*>/i',$document,$elements);

$match = implode("\r\n",$elements[0]);

return $match;

}

 

This should return the following

<div class="record" id="one">

                <div class="rideon">

                                <h2>

                                                <span>Welcome to
Rideon</span>

                                </h2>

                </div>

</div>

</div class="record" id="one">

 

 


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux