Skip to content

Instantly share code, notes, and snippets.

@habibun
Created May 21, 2015 12:10
Show Gist options
  • Save habibun/230dad7bdf32dfe009a8 to your computer and use it in GitHub Desktop.
Save habibun/230dad7bdf32dfe009a8 to your computer and use it in GitHub Desktop.
Deprecated: preg_replace(): The /e modifier is deprecated
$event['method'] = 'on'.preg_replace(array(
'/(?<=\b)[a-z]/ie',
'/[^a-z0-9]/i'
), array('strtoupper("\\0")', ''), $event['event']);
replace with
$event['method'] = 'on'.preg_replace_callback(array(
'/(?<=\b)[a-z]/i',
'/[^a-z0-9]/i',
), function ($matches) { return strtoupper($matches[0]); }, $event['event']);
$event['method'] = preg_replace('/[^a-z0-9]/i', '', $event['method']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment