Hi,
I have a PHP routine that writes to a text file. An example output line would be:
fputs($fp, $form["notify_1"] . "\n");
Where $form["notify_1"] is an array of form variables passed to it. What I wish to do
is prior to writing to the text file, I want to search and replace all ')' with '}'
and all '(' with '{'. I did the following change to the line of code above and wrote
the following function:
fputs($fp, txt_change($form["notify_5"]) . "\n");
function txt_change($txt_string) {
$prt_string = str_replace("(", "{", $txt_string);
$prt_string = str_replace(")", "}", $txt_string);
return $prt_string;
}
My problem is that the search and replace is NOT working. According to the manual, my
syntax for "str_replace" is correct. Does anyone have an idea?
Thanks,
Don