/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php function str2url($title,$sep = "-"){ $exclude = array("!","@","#","$","%","^","&","*","(",")","=","{","}","[","]","|","\\","/","?","<",">","~","`","_","+","=","-"); $output = NULL; foreach($pieces as $key => $val){ if($pieces[$key+1] == NULL){ $sep = NULL; } $output .= $val.$sep; } return $output; } echo str2url("Evan Walsh Rocks"); // returns evan-walsh-rocks ?>
URL: http://nothingconcept.com