Hi
I am trying to create a method that will create a friendly url for use within my site when a field value is posted and sent to it.
So far, what i have below is not quite working and I can't see why:
function ConvertName2URL($source) {
$tempconvert = strtolower($source); // convert to lowercase (this works)
$tempconvert = str_replace("&", "&", $tempconvert); // replace ampersands with valid xhtml (this does not work)
$tempconvert = str_replace(" ", "-", $tempconvert); // replace spaces with dashes (this works)
$tempconvert = str_replace("'", "", $tempconvert); // replace quotes with nothing (this does not work)
return $tempconvert;
}
If anyone has a suggestion as to what a better solution to my problem woudl be I would be very grateful.
Thanks