$string = "This is a test string!"; $urlSafeString = JApplicationHelper::stringURLSafe($string); echo $urlSafeString;
$string = "This string contains numbers: 12345"; $urlSafeString = JApplicationHelper::stringURLSafe($string); echo $urlSafeString;
$string = "This string contains special characters: !@#$%^&*()_+"; $urlSafeString = JApplicationHelper::stringURLSafe($string); echo $urlSafeString;This will output "This-string-contains-special-characters". The JApplicationHelper class is part of the Joomla Platform library.