- var_dump: documentation ( source)
- preg_match_all: documentation ( source)
- implode: documentation ( source)
- strtolower: documentation ( source)
<?php
$option = 'maxFileSize';
preg_match_all( '#((?:^|[A-Z])[a-z]+)#', $option, $matches );
if ( isset( $matches[1] ) && strlen( strtolower( implode( '_', $matches[1] ) ) ) >= strlen( $option ) )
{
$option = strtolower( implode( '_', $matches[1] ) );
}
var_dump( $option );