Skip to content

Instantly share code, notes, and snippets.

@chanakasan
Last active December 19, 2015 11:09
Show Gist options
  • Save chanakasan/5946144 to your computer and use it in GitHub Desktop.
Save chanakasan/5946144 to your computer and use it in GitHub Desktop.
<?php
/**
* Take a string_like_this and return a StringLikeThis
*
* @param string
* @return string
*/
function _snakeToCamel($val) {
return str_replace(' ', '', ucwords(str_replace('_', ' ', $val)));
}
function _snakeToCamel($val) {
$val = str_replace(' ', '', ucwords(str_replace('_', ' ', $val)));
$val = strtolower(substr($val,0,1)).substr($val,1);
return $val;
}
function _snakeToCamel($val) {
$val = str_replace(' ', '', ucwords(str_replace('_', ' ', $val)));
$val = strtolower(substr($val,0,1)).substr($val,1);
return $val;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment