0

My style of programming requires the use of Word, and magic quotes cannot be turned off on the machine I work on without breaking other Word utilities I use. I need a way to clear magic quotes automatically and, if possible, remotely from a PHP script, using PHP, Perl or JavaScript.

I will often have a thousand or more statements running at once; on one script. If only one magic quote has worked its way through, I must identify the error by trial and error (they're impossible to see), that is by going to an identical magic quote (left or right) and copy-pasting it to the replace utility in Wordpad, where I've pasted my scripting, and then hitting replace.

If this happens forty times in a day (maximum), I might lose an hour or two doing this stupid task.

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
  • 1
    I'm curious why you would use Word as a programming editor, it is most unsuited in general. Code folding, syntax colouring and autocomplete await you in several decent IDEs: Netbeans, Eclipse, PHPStorm... – halfer May 06 '13 at 18:07

1 Answers1

0

This is the kind of script I would like to adapt to my problem; instead of deleting lines with a 0 in front and writing the output to a new file, it would write changed content to a new file with curlyquotes changed to straight quotes.

?>php
$file = file("text.php");
$newLines = array();
foreach ($file as $line)
if (preg_match("/^(-\d+|0)/", $line) ===0)
$newLines[] = chop($line);
$newFile = implode("\n", $newLines);
file_put_contents("demo2.txt", $newFile);
<?
John
  • 1