Capturing Text Inside HTML or XML Tags
<?php
$text = "<p>This is some text here \"</p>\".</p>";
ereg("<p>(([^<\"]|[^<]*<[^\/][^<])*(\"[^\"]*\"([^<\"]|[^<]*<[^\/][^<])*)*)?<\/p>", $text, $matches);
echo "Found text: " . $matches[1] . "\n";
?>
Related examples in the same category