/ Published in: Other
                    
                                        
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
function makeInternetSafe($text) {
$text = stripslashes($text);
$text = mb_strtolower($text, 'utf-8');
$forbidden = array('Ä', 'Ö', 'Å', 'ä', 'ö', 'å', ' ', '#');
$replace = array('A', 'O', 'a', 'a', 'o', 'a', '_', '-');
$text = str_replace($forbidden, $replace, $text);
$text = preg_replace('#[^a-z0-9._-]#', '', $text);
return $text;
}
Comments
 Subscribe to comments
                    Subscribe to comments
                
                