Skip to content

Instantly share code, notes, and snippets.

@aJamDonut
Last active May 16, 2020 23:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aJamDonut/a10fa4c0280747e45c02f4018454e16c to your computer and use it in GitHub Desktop.
Save aJamDonut/a10fa4c0280747e45c02f4018454e16c to your computer and use it in GitHub Desktop.
//For Gist: https://gist.github.com/im4aLL/548c11c56dbc7267a2fe96bda6ed348b
preg_match('/Event::trigger\(((\'|\").*)(,|\',) \[(.*)]\)/', $line, $matches);
if(count($matches)>0) {
var_dump($matches);
/*array(5) {
[0]=>
string(40) "Event::trigger('get_cp_menu', [&$menus])"
[1]=>
string(13) "'get_cp_menu'"
[2]=>
string(1) "'"
[3]=>
string(1) ","
[4]=>
string(7) "&$menus"
}
array(5) {
[0]=>
string(70) "Event::trigger("get_cp_menu_".$subMenuCheck['codename'], [&$subItems])"
[1]=>
string(40) ""get_cp_menu_".$subMenuCheck['codename']"
[2]=>
string(1) """
[3]=>
string(1) ","
[4]=>
string(10) "&$subItems"
}*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment