Currently I am opening php files as text using fread and stripping out html tags some contents and trying to strip the contents between php tags. I have tried using strip_tags() and preg_replace ("/<\?.?\?[ ]>/i", "", $mylines), these solutions seem to work fine for php pages where there are html tags, however if the entire page being searched is entirely enclosed in php delimeters, both methods fail (the string resulting should be "" in this case).
Is there a solution (preferably using pcre) to this problem?
Any help would be much appreciated.