I have a variable as shown below with upper case initials and a space. What would be ideal way to format so that it lower case the initials and puts "-" dash in between. So end result should be "los-angeles":
$city = "Los Angeles";
convert to
$city ="los-angeles";
But if you’re trying to create url it won’t be enough.