Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<!-- log4j2.xml - Example log4j configuration file
Place this file in the same directory as your server.jar, edit
to taste, and add -Dlog4j.configurationFile=log4j2.xml to your
server startup flags.
More log4j example configs can be found at
<http://logging.apache.org/log4j/2.x/manual/appenders.html>.
-->
function decamelize($input_string) {
return preg_replace_callback(
'#(^|[a-z])([A-Z])#',
function (array $matches) {
$result = '';
if (0 === strlen($matches[1]))
$result = $matches[2];
else
$result = "{$matches[1]}_{$matches[2]}";
$result = strtolower($result);