Skip to content

Instantly share code, notes, and snippets.

@calpo
Created March 26, 2013 07:09
Show Gist options
  • Save calpo/5243629 to your computer and use it in GitHub Desktop.
Save calpo/5243629 to your computer and use it in GitHub Desktop.
function toSnakeCase($str)
{
return strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $str));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment