I want to include a file, but instead of printing output I want to get it as string.
For example, I want include a file:
<?php echo "Hello"; ?> world!
You can use php buffers like this:
<?php ob_start(); include('other.php'); $script = ob_get_contents(); // it will hold the output of other.php ob_end_clean();