Is there a way to search the PHP content body while it is being parsed by PHP for certain keywords, so I can include CSS and JS files based on the presence of those keywords before the page is being served?
If PHP would have a variable like $_CONTENT_BODY where it outputs the parsed page into, then I could search for keywords like in this example:
if(stripos($_CONTENT_BODY, 'usetinymce') !== false)) echo '<script type="text/javascript" src="http://a.host.com/js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>';