Hi Sven, i was in the need to allow <?php Tags within template-layers which caused me some problems at first as i ran into the situation you described. I was able to solve this problem quite well using this function: /** Â*Â@paramÂÂÂstringÂ$content Â*Â@returnÂÂstring Â*Â@deprecated Â*/ function ParsePHP ( $content ) { ÂÂÂÂpreg_match_all(Â"#\<\?php(.*?)\?\>#sim"Â,Â$contentÂ,Â$source_partsÂ); ÂÂÂÂforeachÂ(Â$source_parts[1]ÂASÂ$idÂ=>Â$php_sourceÂ)Â{ ÂÂÂÂÂÂÂÂob_start();Â ÂÂÂÂÂÂÂÂeval(Âereg_replace(Â"\\$([a-zA-Z_][a-zA-Z0-9_]*)"Â, "\$GLOBALS[\"\\1\"]" , $php_source ) ); ÂÂÂÂÂÂÂÂ$contentÂ=Âstr_replace(Â$source_parts[0][$id]Â,Âob_get_contents()Â, $content ); ÂÂÂÂÂÂÂÂob_end_clean(); ÂÂÂÂ} ÂÂÂÂreturnÂ$contentÂ; } Adding some minor changed would allow you to use custom opening and closing tags (in fact you would just replace the <\?php with <\?xyz and would be done. I'm using the regular expression to replace ÂÂ"\\$([a-zA-Z_][a-zA-Z0-9_]*)"Â with ÂÂ"\$GLOBALS[\"\\1\"]" to make sure all variables are found as we are within the function's scoope and not within the global one. Maybe this helps some ppl. -- red > The only downside: No single quote (') is possible outside <?xyz ... ?> > tags in the file included. This can of course be fixed, but only with a > ridiculous amount of code. If only there was a way to do heredoc > strings that DON'T parse variables (like in Perl). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php