slug() public static method
Returns a string with all spaces converted to given replacement, non word characters removed and the rest of characters transliterated.
If intl extension isn't available uses fallback that converts latin characters only and removes the rest. You may customize characters map via $transliteration property of the helper.
public static string slug ( $string, $replacement = '-', $lowercase = true ) | ||
---|---|---|
$string | string |
An arbitrary string to convert |
$replacement | string |
The replacement to use for spaces |
$lowercase | boolean |
Whether to return the string in lowercase or not. Defaults to |
return | string |
The converted string. |
Please login to continue.