Last active
August 29, 2015 13:56
-
-
Save dominikwilkowski/8968477 to your computer and use it in GitHub Desktop.
TINY STING TO URL CLEANER (Handleizer)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*****************************| STRING TO URL |*****************************/ | |
/** | |
* TINY STING TO URL CLEANER | |
* | |
* @param string $t String to be converted | |
* | |
* @return string string stripped off of all characters but A-Za-z0-9 and dash, spaces are converted to dash | |
*/ | |
function makeURL($t) { return strtolower(substr(preg_replace("/[^\w-]+/","",str_replace(" ","-",$t)),0,20)); } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment