Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Сергей Шевченко
Added: Sep 12, 2018 12:42 PM
Modified: Sep 13, 2018 1:49 PM
Views: 4
Tags: no tags
  1. function snakeToCamel ($str) {
  2.     // Remove underscores, capitalize words, squash, lowercase first. (Example: one_two_three --> oneTwoThree)
  3.     return lcfirst(str_replace(' ', '', ucwords(str_replace('_', ' ', $str))));
  4. }