Hello,
I haven't tried to use files for input and output becuase I could never get them to work correctly. Well, Drew from this forum was good enough to provide the following script to convert one text to another.
However, I keep receiving the error below when I execute the script.
I have the links.txt file located in my root web directory same as the menu_code_text.php file.
Where does the new.txt file get created ???
Warning: fopen(new.txt): failed to open stream: Permission denied in /usr/www/users/######/menu_code_test.php on line 8
Any help would be appreciated to get me over this hump.
Thanks,
Gary
<?php
$oldFile = "links.txt";
$outFile = "new.txt";
$data = file($oldFile);
$fp = fopen($outFile, "w+");
foreach($data as $one) {
preg_match("/<option value=\"(.)\">(.)</option>/i", $one, $matches);
fwrite($fp, "\"text:{$matches[2]}\" \"4\" \"\" \"LINK:{$matches[1]},_blank\" \"{$matches[2]}\"\r\n");
}
fclose($fp);
?>