Skip to content

Instantly share code, notes, and snippets.

Avatar

Tom Butler TRPB

  • Dr. Thomas Butler, Web Developer, University Lecturer
  • Milton Keynes, United Kingdom
View GitHub Profile
@solleer
solleer / Readable.php
Last active Apr 12, 2017
Transphporm Readable Formatter
View Readable.php
<?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) {