How To Get All HTML Within Element? (DOM Parser)

I would like to get ALL the html between a pair of <form> tags and then replace some of the text between the fields. I am absolutely stumped on how to do this. So far I have come up with the following which obviously retrieves the entire page. Would appreciate some help with this :).


<?php
include ('simple_html_dom.php');
?>

<?php
$html = file_get_html('http://www.mysite.com');
echo $html
?>

I wasn’t able to edit the above and I’ve made some progress:

I would like to get ALL the html between a pair of <form> tags and then replace some of the content. So far I have come up with the following which retrieves the form.


<?php
include ('simple_html_dom.php');
?>

<?php
$html = file_get_html('http://www.mysite.com');

echo $html->find('form[name=form1]', 0);
?>

But how do I then go about removing the following HTML within the form?


<img src="/image.jpg" alt="picture"> 

And replacing the following HTML within the form?


<div align="center"><span class="style1"><br>Replace this text with my own.</span><br>