7 Years
Discussion Span
Last Post by fobos

You can use the PHP Document Object Model (DOM), an example:

    $f = '
            <div id="aaa">apples</div>
            <div id="bbb">oranges</div>
    $dom = new domDocument;
    $dom->preserveWhiteSpace = false;
    $t = $dom->getElementsByTagName('div');
    $newElement = $t->item(0)->nodeValue; // 0 to display #aaa, 1 for #bbb
    echo $newElement . "\n";

Thanks for the help cereal. i was trying to echo the website into $f, then pull the div by id. 1, how do i get the web content into a variable.. like $f = geturlcontent? then call the div. 2, can i use $t = $dom->getElementById($f); to get the div that i want? basically what im trying to do is get stats of players from one website and post it on mine. this way ppl can come to my website and view stats of players and not have to visit the original website

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.