Hi I'm currently working with a project in which the following occurs;
$example = $array[key]
instead of
$example = $array['key'] or $example=$array["key"]
I'm trying to use regex to update these old array key strings. I currently have the following;
(\$([a-z0-9_]*)\[(?!('|"))([a-z0-9_]*)(?!('|"))\])
This matches $array[key], but also matches things like this;
$array[]$array inside a javascript tag.
The code is also very old and has script tags inside php files, without a framework.
I'm using regex inside Notepad++, does anyone think they could write me a regex query to capture non string array keys and avoid $array[], $array[$variable] and $array inside script tags, and replace them with quotes?
Thank you
