I have a large amount of PHP code that I have taken over from another programmer. However, the previous developer's programming style has been throwing me tons of notice of use of undefined constant's because he didn't quote the array values like the PHP manual recommends. I need a way to easily replace all these values with proper quoting. This is easy enough to do with a simple regex but the problem I am having is that it cannot quote array values that are already in a quoted string.
$array[value] needs to become $array['value']
"$array[value]" should be left alone.