php - How To Regex Search and Replace array_key_exists with isset? -


whats best way regex search , replace instances of array_key_exists() more efficient isset()? please, no donald knuth quotes regarding optimizations , yes, i'm aware of differences between 2 functions.

this i'm using in netbeans search , replace:

  • search for:

    array_key_exists\s*\(\s*'([^']*)'\s*,([^)]*)\)  
  • replace with:

    isset($2['$1']) 

it works , changing this:

array_key_exists('my_key',$my_array) 

to

isset($my_array['my_key']) 

but doesn't pick instances this:

array_key_exists($my_key,$my_array) 

not elegant solution, adding current regex find both types of search criteria.

array_key_exists\s*(\s*'|$['|\s]\s*,([^)]*))


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -