Yeah - it's well weird. I'm running the code and it's telling me that the string position of id="myDiv" is 95, which is absolute crap.
I'll modify the code to make it work and slap it up in a sec
And make sure you either put the function in a seperate file and include it, which I assume you're going to do if this is used on loads of pages, OR put the function at the bottom of each page so it doesn't search within itself.
[TIME PASSES] Dammit - had a bracket in the wrong place when calculating the start offset - new and working code, even tested with your page:
function outputDescription()
{
$html = file_get_contents($_SERVER['SCRIPT_FILENAME']);
// find the starting offset
$startMatch = 'id="myDiv">';
$endMatch = '</div>';
$startOff = strpos($html, $startMatch) + strlen($startMatch);
$endOff = strpos($html, $endMatch, $startOff);
$html = substr($html, $startOff, $endOff - $startOff);
// if you want 300 characters of text AFTER the stripping
// now strip the tags off the stuff inside
$html = strip_tags($html);
echo substr($html, 0, 300);
}