Hello Drew,
Thanks for the code. I'm in the processing of working on it right now.
I setup a web page to input the data and then send it to the processing page.
Right now I copy and paste the old text in a submit text window:
<option value="http://www.amana.com">Amana</option>
<option value="http://www.ariston.com">Ariston</option>
and when it gets to the processing page it looks like:
Amana
Ariston
It is not echoing the statements correctly. I'm I missing some statement that checks for escape characters?
Below is the code I am using:
input ----
<form action="http://www.hintsforhomes.com/menu_convert_final.php" method="POST">
<textarea name=code_input rows=20 cols=78></textarea>
<input type="submit" value=" Submit " name="submit2"></td>
</table>
</form>
output ----
<?php
$code_input = nl2br($code_input);
echo $code_input;
$todayis = date("l, F j, Y, g:i A");
$month = date("m");
$day = date("d");
$year = date("Y");
$a = floor((14-$month)/12);
$y = floor($year+4800-$a);
$m = floor($month+12*$a-3);
/------------------------- Begin Menu Conversion Process ------------------------/
$oldFile = $code_input;
$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);
?>
I would like the output file as $outFile, and I will just display this on a webpage (ie.,
<table width="760" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="20"><?php echo $outfile ?></td>
</tr>
<tr>
<td height="78">
<hr align="center" width="100%" size="4" noshade color="#000000">
</td>
</tr>
</table>
Thanks very much,
Gary