I am trying to create a dynamic script generator. My idea is to have the following scripts:
input.php
$colour="brown";
$animal ="cat";
template.php
echo "<p>This is a $colour \$animal</p>";
magic.php (This script is what I need help to write)
takes input.php and template.php and creates and saves a file output.php like this:
output.php
echo "<p>This is a brown $animal.</p>;
So, when I run...
index.php
$animal = "cow";
require ('output.php');
...I get this in my browser:
This is a brown cow
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.