fork download
  1. <?php
  2.  
  3. function url_amigavel($string){
  4. $url = str_replace(' ', '_', $string);
  5. $url = preg_replace("/&([a-z])[a-z]+;/i", "$1", htmlentities($url));
  6.  
  7. return strtolower($url);
  8. }
  9.  
  10. echo url_amigavel('alguma coisa & um #@><teste');
Success #stdin #stdout 0.02s 24192KB
stdin
Standard input is empty
stdout
alguma_coisa_a_um_#@glteste