I wrote a script for finding tag-delimited keywords in a string a few days ago,
this might be usefill for you to find the keywords in your app.
<?
$line = "hello, this is a <? id=2 ?> string that needs some <? id=4 ?> work";
while we can find "<?" markers
while ($last_pos=strpos($line,"<?"))
{
print what is in front of marker
print substr($line,0,$last_pos)."\n";
Trash what is in front of the marker
$line = substr($line,$last_pos);
Find the end marker
$last_pos = strpos($line,"?>")+2;
Get what is between the markers, +3 and -6 to get rid of the markser themselves plus the spaces around the markers
$replace_me = substr($line,3,$last_pos-6);
get the key and value
$pieces=explode("=",$replace_me);
print "img src=image.php?$pieces[1]\n";
trash the part between and including the markers.
$line = substr($line,$last_pos);
$last_pos = strpos($line,"<?",0);
};
Don't forget to print the last bit, the part that is left when no more markers exist!
print $line;
print "\n";
?>