Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
TINY STING TO URL CLEANER (Handleizer)
<?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
You can’t perform that action at this time.