php replace my tags (as array key) with array value
<p>Sorry, I am confused to create a correct title. This is my problem, I have a TXT file:</p>

<pre><code>{{title}}&lt;br /&gt;{{content}}
</code></pre>

<p>And this is the PHP file:
I load file.txt and replace tags {{variable}} with value from $data['variable']</p>

<pre><code>$data = array ( 'title' =&gt; 'Hello', 'content' =&gt; 'WORLD!!');
$file = file_get_contents("file.txt");
$key = array_keys($data);
$value = array_values($data);
$file = str_replace($key, $value, $file);
echo $file;
</code></pre>

<p>nothing change from file.txt </p>

<p>I have 2 way to solve this by assign array's key in this format </p>

<pre><code>'{{variable}}' =&gt; 'value' 
</code></pre>

<p>or write </p>

<pre><code>str_replace(array('{{','}}'),'',$file) 
</code></pre>

<p>before </p>

<pre><code>echo $file; 
</code></pre>

<p>Is there are another way?</p>

<p>thx before...</p>
