replacing variables in output in php
<p>Right now I have this code.</p>

<pre><code>&lt;?php
    error_reporting(E_ALL);

    require_once('content_config.php');

    function callback($buffer)
    {
        // replace all the apples with oranges
        foreach ($config as $key =&gt; $value)
        {
            $buffer = str_replace($key, $value, $buffer);
        }
        return $buffer;
    }

    ob_start("callback");
?&gt;
some content
&lt;?php

ob_end_flush();

?&gt;
</code></pre>

<p>in the content_config.php file:</p>

<pre><code>$config['SiteName'] = 'MySiteName';
$config['SiteAuthor'] = 'thatGuy';
</code></pre>

<p>What I want to do is that I want to replace the placeholders that with the key of the config array with its value.</p>

<p>Right now, it doesn't work :(</p>
