Skip to content

Instantly share code, notes, and snippets.

View TRPB's full-sized avatar

Tom Butler TRPB

View GitHub Profile
@solleer
solleer / Readable.php
Last active April 12, 2017 01:26
Transphporm Readable Formatter
<?php
namespace Config\Transphporm\Readable;
class Readable {
private function camelCase($val) {
$words = preg_split('/(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])/', $val);
return implode(' ', $words);
}
public function readable($val, $splitOnDashes = false) {