I hereby claim:
- I am mmerian on github.
- I am mmerian (https://keybase.io/mmerian) on keybase.
- I have a public key whose fingerprint is 3032 18FA 1448 7105 110B 4B9A 41E5 35B0 BB98 1B1B
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
I'm writing this up from memory, so errors may appear.
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
<?php | |
function slugify($str) | |
{ | |
$str = htmlentities($str, ENT_NOQUOTES, 'UTF-8'); | |
$str = preg_replace('#&([A-za-z])(?:acute|cedil|circ|grave|orn|ring|slash|th|tilde|uml);#', '\1', $str); | |
$str = preg_replace('#&([A-za-z]{2})(?:lig);#', '\1', $str); // pour les ligatures e.g. 'œ' | |
$str = preg_replace('#&[^;]+;#', '', $str); // supprime les autres caractères | |
$str = preg_replace('/[^a-z0-9]+/', '-', strtolower($str)); |