PHP Get Contents and Include Not Quite What I Need

I've got a function like:\[code\]function get_div(){ $fileLocation = 'form.php'; $returnString = '<div id="myDiv">' . get_php_file($fileLocation) . '</div>'; echo $returnString;}function get_php_file($file){ return file_get_contents($file);}\[/code\]the problem is I have PHP in that file that I want executed as if it were part of the script. (Instead of outputting \[code\]<?php my_function() ?>\[/code\] throughout my page)If I use \[code\]include $file\[/code\] instead of \[code\]file_get_contents()\[/code\] I end up with the included file, but the rest of my \[code\]$returnString\[/code\] is shot... Thoughts?
 
Back
Top