/ Published in: PHP
Turn a string into camelcase. You can optionally set a custom regex delimiter.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
{ function camelCase($subject, $delimiters=' _-', $lcfirst=true) { { throw new Exception("Subject must be of type string"); } foreach ($subject as $key => &$word) { } if ($lcfirst) { : } return $subject; } } // "usingPHPTurnThisIntoCamelCASENow" echo camelCase("Using PHP turn This into camelCASE, now!");