- array_map: documentation ( source)
- microtime: documentation ( source)
- implode: documentation ( source)
- explode: documentation ( source)
- strtolower: documentation ( source)
<?php
$test = 'String_With_Underscores';
$start = microtime(true);
for ($i = 0; $i < 10000; $i++) {
$result = implode('', array_map('ucfirst', explode('_', strtolower($test))));
}
echo 'Time taken: ' . (microtime(true) - $start) . 's';