But say you're searching for a specific element, and you're not sure what the parent div is, but you want to modify it? Or say you're searching for a link, but you want all the HTML around it (so everything in the <p> or <div> block). Then you'd want to search for the element, then get the parent.
My interpretation of the question of the OP was that they were reading something like an HTML page from file_get_contents() and trying to get the parent div of a specific element. In this case, looping through wouldn't be the most efficient way to figure it out (though it could be done). Otherwise, every other answer in this thread is sufficient to get the parent. But without a reply from the OP, not much we can do but speculate.