I'm trying to figure out how can I execute HTML and PHP code from a class type controller and store the result into a variable to simulate the behavior of some MVC oriented frameworks, example:
I have a variable called $mystic_var and I want to use this var with a strange function (I don't know which function is) to read a .php file, execute it and store the result into my $mystic_var
Assume try.php has the following content:
<html>
<head></head>
<body><?php echo "Hello world"; ?></body>
</html>
Then I execute $mystic_var = mystic_function('try.php'); and then if I check my $mystic_var, it will have something like this:
<html>
<head></head>
<body>Hello World</body>
</html>