Hi all I am looking for the best way to change the %20 in my URL's to a - I currently make the URL like this echo"<td><a href='further-info/$id/$make/$model' class='no_under'>$make $model</a></td>"; PHP: But as the model field has spaces in it makes a URL like this. http://www.my-site.co.uk/dual_control_car_hire/further-info/28/BMW/Mini%20Cooper%20-%201.6%20diesel But I want one like http://www.my-site.co.uk/dual_control_car_hire/further-info/28/BMW/Mini-Cooper---1.6-diesel Cheers John
NeoCambell is right, you can replace the spaces with hyphens using str_replace. Just make sure you use it before you require it: // URLify the url $makeURL = str_replace(" ", "-", $make); $modelURL = str_replace(" ", "-", $model); // Print out table cell echo"<td><a href='further-info/$id/$makeURL/$modelURL' class='no_under'>$make $model</a></td>"; PHP: