php - Help with regular expression -


I am changing some associative array database calls to object objects that are objected to. So I have to start a regg app that I can use to find and convert to convert:

$ rsName ['fieldName'] to $ rsName- & Gt; FieldName

  preg_replace ('/ \ $ rsName \ [(\' (* . *?) \ '\] /', '$ $Net-> $ 1', $ str);  

In addition, this key will escape the ' in the string.

What do you intend to run it? eval () ? Bad idea, if that is so.

Also assumes that $ rsName is a constant.


Comments