Sorry, I am confused to create a correct title. This is my problem, I have a TXT file:
{{title}}<br />{{content}}
And this is the PHP file: I load file.txt and replace tags {{variable}} with value from $data['variable']
$data = array ( 'title' => 'Hello', 'content' => 'WORLD!!');
$file = file_get_contents("file.txt");
$key = array_keys($data);
$value = array_values($data);
$file = str_replace($key, $value, $file);
echo $file;
nothing change from file.txt
I have 2 way to solve this by assign array's key in this format
'{{variable}}' => 'value'
or write
str_replace(array('{{','}}'),'',$file)
before
echo $file;
Is there are another way?
thx before...