Okay I have 1 file formatted like so:
Key-Item
Key2-Item2
Key3-Item3
And then I have PHP Code like this:
Say $code is the contents of the above file
$parts = explode("\n", $code);
for ($i = 0; $i < count($parts); $i++) {
$items = explode('-', $parts[$i], 2);
$contents .= '$'.$items[0].' = \''.$items[1].'\';'."\n";
}
And then it writes $contents to a PHP file and YES, proper replacements were done( ' => \' and \ to \) and YES $contents is wrapped with PHP tags (<?php ?>)
BUT the output comes out like this:
<?php
$key1 = 'Value
';
$key2 = 'Value
';
?>
I dont get why :rolleyes: