I want to call require_once("test.php") but not display result and save it into variable like this:
$test = require_once('test.php');
//some operations like $test = preg_replace(…);
echo $test;
Is it possible?
………………………
Thank you guys! :)
Solution:
test.php
<?php
$var = '/img/hello.jpg';
$res = <<<test
<style type="text/css">
body{background:url($var)#fff !important;}
</style>
test;
return $res;
?>
main.php
<?php
$test = require_once('test.php');
echo $test;
?>