help with statement

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

 



I'm trying to take a paragraph then break it into linebreaks and grab each
line separately but it's not working, I can get the paragraph but my lines
are not I get the object id #6 or #7 everytime
Here's my code

// grab all the paragraphs on the page
$xpath = new DOMXPath($dom);
//$graphs = $xpath->evaluate("/html/body//p");
$graphs=$dom->getElementsByTagName("p");
$lines=$dom->getElementsByTagName("br");
// Set $i =5 because first 5 paragraphs are not inspections
for ($i = 5; $i+1 < $graphs->length; $i++) {
    $paragraph = $graphs->item($i);


    $text = $dom->saveXML($paragraph);
    $text = trim($text);

    /*
        //my experiment for getting line br
        for ($b = 1; $b+1 < $lines->length; $b++) {*/
    $title = $lines->item($i);
    $addie= $lines->item($i);



    if($TESTING)
        echo "<br />$i Graph: " . $text . "<br />";
        echo "<br />$line: " . $title . "<br />";
        echo "<br/>$line:" . $addie . "<br/>";
    // }
}


?>



Thanks
Terion

Happy Freecycling
Free the List !!
www.freecycle.org
Over Moderation of Freecycle List Prevents Post Timeliness.
Report Moderator Abuse Here:
http://www.freecycle.org/faq/faq/contact-info
Or Email Your Complaint to:
faq@xxxxxxxxxxxxx or info@xxxxxxxxxxxxx
------------------------------------------------
Twitter?
http://twitter.com/terionmiller
------------------------------------------------
Facebook:
<a href="http://www.facebook.com/people/Terion-Miller/1542024891";
title="Terion Miller's Facebook profile" target=_TOP><img src="
http://badge.facebook.com/badge/1542024891.237.919247960.png"; border=0
alt="Terion Miller's Facebook profile"></a>

[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