Skip to content

Instantly share code, notes, and snippets.

@lbvf50mobile
Last active October 26, 2020 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lbvf50mobile/0a33adccbbd5e54cf89e4465ac6b4f41 to your computer and use it in GitHub Desktop.
Save lbvf50mobile/0a33adccbbd5e54cf89e4465ac6b4f41 to your computer and use it in GitHub Desktop.
Just PHP FUN 138.
<?php
# https://www.codewars.com/kata/57f8ff867a28db569e000c4a Kebabize.
function kebabize($string) {
$string = preg_replace('/[0-9]+/',"",$string);
$string = preg_replace ('/([A-Z])/','-\1',$string);
return strtolower(trim($string,"-"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment