I'd like to grep a collection of PHP scripts for an array variable called, in this case, $year[x]. Lots of script have $year variables, but I'm only interested in the arrays, so I'd like to find '$year['. Grep is pretty hard to get along with, though, when I'm trying to find a string that includes a bracket, escaping it (\$year\[) doesn't seem to help, and you'd be surprised at how many Google hits for "grep string bracket' turn up exactly the wrong results.
Anybody know how I can do this?
TIA
Anybody know how I can do this?
TIA